-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug with catch-all routing #2169
Comments
Hello, Mr. I. Stanko! What's happening? Also, why was the issue closed? Was there no bug? :) |
The configuration appears to be slightly incorrect. The 2nd route is a catch-all, while the first route processes all query strings. Defining the 1st route when the 2nd one is a catch-all seems redundant, as the 2nd route should be able to process all URLs from the first route, including all query strings. Merging both routes into one could be done as follows: {
"UpstreamPathTemplate": "/api/products/{everything}",
"DownstreamPathTemplate": "/api/products/{everything}",
} Wouldn't this approach be effective? |
Please read this doc carefully → Empty Placeholders |
Are you sure? 😉
This ought to be verified by our routing tests, and it's concerning if it's not, as it may indicate a bug. |
Duplicate of #2132 |
Duplicate of #2064 |
Hello, Thanks for reply. The problem here is that the downstream route is different. |
OK, but when you have one service instance with different downstream paths, why do merge paths in upstream? {
"UpstreamPathTemplate": "/api/products-something?{everything}",
"DownstreamPathTemplate": "/api/products-something?{everything}",
},
{
"UpstreamPathTemplate": "/api/products/{id}",
"DownstreamPathTemplate": "/api/products/{id}",
} and moreover, it must be one Catch All route ❗ {
"UpstreamPathTemplate": "/{everything}",
"DownstreamPathTemplate": "/{everything}",
}, Don't say "thank you" |
Mr. I, what's your full name? |
The thing here is that the {id} should not be Catch All, but placeholder for variable. |
Mr. @istanko, will you open a PR in November'24? |
@int0x81, welcome to your assignment! |
Hello,
I have a problem with two get routes. One of them is not getting hit.
Expected Behavior / New Feature
With the following configuration, expected behavior should be that calling /api/products?query=test is redirected to the downstream path template /api/products?query=test, and that calling /api/products/1 is redirected to the downstream path template /api/products/1
Actual Behavior / Motivation for New Feature
Calling /api/products/1 will be routed to downstream path template /api/products?1
Steps to Reproduce the Problem
Use the provided configuration and make calls to both endpoints.
Specifications
The text was updated successfully, but these errors were encountered: