Skip to content

getServletPath() always returns empty when matching URL in Zuul API gateway flow control #1109

@fusc2018

Description

@fusc2018

Issue Description: context.getRequest().getServletPath() always empty

type: bug

Class :PrefixRoutePathMatcher.class

Method: test

Content:

    @Override
    public boolean test(RequestContext context) {
        String path = context.getRequest().getServletPath();
        if (canMatch) {
            return pathMatcher.match(pattern, path);
        }
        return false;
    }

How to reproduce it (as minimally and precisely as possible)

  @Override
    public boolean test(RequestContext context) {
        String path = context.getRequest().getRequestURI();
        if (canMatch) {
            return pathMatcher.match(pattern, path);
        }
        return false;
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions