Closed wolf8334 closed 4 years ago
I suggest add a predicate matching all the paths, because looks like you want the filter to execute in all the cases. I have also faced this problem, as I am building the routes in dsl, I use the following:
.route("rewrite_request_obj", r -> r
.path("**")
.filters(f -> f
.filter(...)
)
.uri(uri)
)
.build();
notice path("**")
IIRC there is an always true predicate or something similar
sorry for interrupt again.I do not quiet understand the word 'IIRC' mean. where can I find the 'always true predicate' ?
Describe the bug I am using SpringCloud Gateway 2.2.1.RELEASE to create my own gateway application with SpringBoot 2.3.3.RELEASE and SpringCloud Hoxton.SR1 JDK 1.8. Here is what I am expecting. When I visit http://localhost:8800/search/1 which provides by the gateway,it guides me to http://localhost:8801/check/1,both forward and redirect are accepted.
Sample For this purpose,I use the configuration below.
When I visit /searchEngine,everything is OK.But when I visit /search/1,my edge told me he finds the status code 500.and my eclipse says here is an exception.
I check the source code and found I need provide at least one Predicate,or the code below will throw exception:
But I do not need the Predicate.So what should I do?