-
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
Upstream route templates that end in a slash are not 'found'. #649
Comments
@PureKrome thanks for your interest in Ocelot, we can take a look at making this work but for now I would suggest just adding the same ReRoute with a / at the end! |
This is not great.. and I don't think the suggestion above is good enough. For example with this re-route:
This works: This doesn't (because of the /{everything}) |
Hello guys! I would say, I remember this problem is described in some other PR's and issues. So, I will find them all to consolidate, but now please confirm the bug existence... |
@ks1990cn Could you help to test these user scenarios please? But for latest v22 only! |
Hi @raman-m - appreciate the feedback. I won't have a chance to test this because I'm not using this anymore and have moved on (at least, for now). Sincerely sorry. Good luck! |
Same for me unfortunately! |
Sure |
@raman-m Working for me on latest.
|
I am too busy to search through Ocelot unit tests and acceptance tests... Do you want to write a couple of acceptance tests to verify user scenarios above plz? Will you have some time for tests coding challenge? 😉 |
Sure, will give a try here |
@joaopgrassi commented on May 5, 2020
I see your user scenario differs from author's one... We will focus on the initial problem without
Let's merge this cases to one definition
|
@raman-m In manual testing api, I saw same here!! Everything is tested okay already in |
@ks1990cn |
Here is link for file- containing all tese cases. @raman-m Ocelot/test/Ocelot.AcceptanceTests/RoutingTests.cs Lines 324 to 374 in d7754af
|
@ks1990cn Our current upstream is |
@ks1990cn
the 1st test is about We are searching for the Config like this
|
This case is covered by should_return_ok_when_upstream_url_ends_with_forward_slash_but_template_does_not because it uses URL |
@raman-m Sorry my screen shot was on different line and I shared was different line. Didn't saw this. But yes its tested ok |
The second test should_return_not_found_when_upstream_url_ends_with_foward_slash_but_template_does_not is not the same because the route config differs: So, the first test is better... |
@ks1990cn |
Hello @ks1990cn Would you like to open PR ? 😉 |
Yes will open PR for it, thank you |
Expected Behavior / New Feature
When I map a specific route and it ends with a
/
I expect it to match to the same route if there was no ending/
.Actual Behavior / Motivation for New Feature
Given two upstream routes where one differ's only with the last character being an
/
then the Router fails to map to the route and returns a404
.Steps to Reproduce the Problem
First, lets define a sample route configuration:
When using Postman, try to hit the following routes:
HTTP POST http://localhost:5002/account/authenticate
<--- SucceedsHTTP POST http://localhost:5002/account/authenticate/
<-- FAILS but expected to succeed.There's no documentation about this, if this is a 'by design' feature.
Specifications
11.0.3
The text was updated successfully, but these errors were encountered: