Closed walter9088 closed 3 years ago
I make simple example to test StripPrefixGatewayFilterFactory
,but it works well,can your post your configure and test codes?(I guess you may call /api/userdevice/userdevice/aa/xxxx
)
Through performance measurement, I found that OpenStripPrefixGatewayFilterFactory.Config did not get the correct parts.
one hours testing ,This problem was reproduced 5 times. the config in apollo: spring.cloud.gateway.routes[3].id = xxxx spring.cloud.gateway.routes[3].uri = lb://xxx spring.cloud.gateway.routes[3].predicates[0] = Path=/api/userdevice/** spring.cloud.gateway.routes[3].filters[0] = AddRequestHeader=code, META spring.cloud.gateway.routes[3].filters[1] = StripPrefix=2 spring.cloud.gateway.routes[3].filters[2].name = Retry spring.cloud.gateway.routes[3].filters[2].args[retries] = 3 spring.cloud.gateway.routes[3].filters[2].args[series] = SERVER_ERROR spring.cloud.gateway.routes[3].filters[2].args[methods] = POST spring.cloud.gateway.routes[3].order = 3
@walter9088 thanks for your feedback,i will create a long time run test to reproduce this issue.
Ok, I'm also investigating the specific reasons, and will continue to sync if there is evidence
spring-boot-starter-parent version:2.1.13.RELEASE
Through performance measurement, I found that OpenStripPrefixGatewayFilterFactory.Config did not get the correct parts.
one hours testing ,This problem was reproduced 5 times. the config in apollo: spring.cloud.gateway.routes[3].id = xxxx spring.cloud.gateway.routes[3].uri = lb://xxx spring.cloud.gateway.routes[3].predicates[0] = Path=/api/userdevice/** spring.cloud.gateway.routes[3].filters[0] = AddRequestHeader=code, META spring.cloud.gateway.routes[3].filters[1] = StripPrefix=2 spring.cloud.gateway.routes[3].filters[2].name = Retry spring.cloud.gateway.routes[3].filters[2].args[retries] = 3 spring.cloud.gateway.routes[3].filters[2].args[series] = SERVER_ERROR spring.cloud.gateway.routes[3].filters[2].args[methods] = POST spring.cloud.gateway.routes[3].order = 3
I have the same problem, do you have any solution ?
<spring-cloud.version>Greenwich.SR2</spring-cloud.version>
Through performance measurement, I found that OpenStripPrefixGatewayFilterFactory.Config did not get the correct parts. one hours testing ,This problem was reproduced 5 times. the config in apollo: spring.cloud.gateway.routes[3].id = xxxx spring.cloud.gateway.routes[3].uri = lb://xxx spring.cloud.gateway.routes[3].predicates[0] = Path=/api/userdevice/** spring.cloud.gateway.routes[3].filters[0] = AddRequestHeader=code, META spring.cloud.gateway.routes[3].filters[1] = StripPrefix=2 spring.cloud.gateway.routes[3].filters[2].name = Retry spring.cloud.gateway.routes[3].filters[2].args[retries] = 3 spring.cloud.gateway.routes[3].filters[2].args[series] = SERVER_ERROR spring.cloud.gateway.routes[3].filters[2].args[methods] = POST spring.cloud.gateway.routes[3].order = 3
I have the same problem, do you have any solution ?
<spring-cloud.version>Greenwich.SR2</spring-cloud.version>
update spring-cloud.version: springboot - 2.2.9.RELEASE springcloud - Hoxton.SR4
Can you provide a complete, minimal, verifiable sample that reproduces the problem? It should be available as a GitHub (or similar) project or attached to this issue as a zip file.
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.
I encountered a problem with StripPrefix configuration forwarding
I want to use StripPrefix to remove the first few digits of the path prefix of my uri request, which can work normally in the case of large amounts of data. But there are a few requests that are on the wrong path when forwarded downward.
case:
predicates Path=/api/userdevice/aa/xxxx filters StripPrefix=2 I hope the request path forwarded is : /aa/xxxx
But the following path will appear: /userdevice/aa/xxxx