Describe the bug
spring-boot-starter-parent 2.1.13.RELEASE
Inherently:
When a route path starts with the same string that happens to be the dispatcher servlet path, that part is stripped when adjusting the path. I don't know, but I presume it is adjusted in case someone accidentally puts their actual servlet path instead of the relative path.
My suggested solution is to check if the full path segment (From / to /) is equal before stripping it from the path.
Sample application.yml
server:
servlet:
context-path: /foo
zuul:
routes:
foobar:
path: /foo-bar/**
url: https://example.com/foo-bar-service
Log:
WARN [app,...] 39689 --- [nio-8221-exec-6] o.s.c.n.z.f.pre.PreDecorationFilter : No route found for uri: /foo-bar/example
Because in https://github.com/spring-cloud/spring-cloud-netflix/blob/baa50c136add5b1be861e04dbf704d3e4ddf6d8c/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/zuul/filters/SimpleRouteLocator.java#L199:
// this.dispatcherServletPath = "/foo", path = "/foo-bar/**"
...
if (!this.dispatcherServletPath.equals("/")
&& path.startsWith(this.dispatcherServletPath)) {
adjustedPath = path.substring(this.dispatcherServletPath.length());
// adjustedPath = "-bar/**"
Comment From: spencergibb
This module has entered maintenance mode. This means that the Spring Cloud team will no longer be adding new features to the module. We will fix blocker bugs and security issues, and we will also consider and review small pull requests from the community.