I was migrating an api gateway application that used spring cloud netflix with zuul to another that uses spring cloud gateway, I found a problem in the migration since the old application allowed sending several slashes in the URL of a request like the following examples, and in all of them it allowed routing to the service 'myapp' correctly:
/ myapp/something
// myapp/something
/// myapp/something
The route configuration in the previous api gateway was:
myapp:
path: /myapp/**
stripPrefix: false
serviceId: myappservice
However, in the new api gateway with spring cloud gateway, when the request is sent and the URL has more than one slash, an error is generated since it cannot map the route:
- id: myapp
uri: https://myappdomain/
predicates:
- Path=/myapp/**
Is it possible to add some kind of regular expression to the route that allows me to validate that if it has one or more slashes at the beginning of the path, it can match with the route?
PD: I must allow the use of multiple slashes in the URL since the clients were integrated this way and I cannot ask them to modify something.
I have tried to place different types of regex but none of them have worked for me, for example: ^/+sso_rest/**
Or I have tried with the ** but neither / ** /sso_rest/ **