Updated CharactersDontMatch method#97
Conversation
At this point the comparer must ignore case sensitive.
|
I´m looking why I didn´t notice this in the tests but seems I don´t understand something with the tests in class CaseSensitiveRoutingTests. Now I have to leave urgently, but in a few of hours I´ll add a comment explaining my doubt. |
|
@juancash I think I originally had an option where a re route could be case sensitive (I'm not sure anyone would ever wants this). Perhaps we can remove that feature if its confusing. |
|
@TomPallister I think it´s not confusing. The method that I changed in this PR it's not related with the property:
This method is in the class UrlPathPlaceholderNameAndValueFinder where the target is look for the values in the upstreamUrlPathTemplate. In this point of the code the upstreamUrlPath and upstreamUrlPathTemplate can combine uppercase and lowercase chars. For this reason, the value search must be independent of whether it is upper or lower case. Both examples must work in a real scenario, but I´m trying this and it´s not like that. However with the change of this PR works fine. My doubt it´s, why the CaseSensitiveRoutingTests don´t detect this? I´m checking this tests but I can´t understand how it works. For example, the following test: If I run this test, pass without problems. All it's OK because the ReRouteIsCaseSensitive property is not defined in the FileReRoute object and it's set to false by default. Now, forget the case sensitive features. If I simply change this:
the test should not pass, because the service is
However the test is still going on. What I´m missing here? Thanks. |
|
@juancash Im going to merge this PR. The fake service in the test this.Given(x => x.GivenThereIsAServiceRunningOn("http://localhost:51879/api/products/1", 200, "Some Product")) Will respond to any HttpRequest. The Ocelot config is set to forward requests from /products/{productId} to /api/products/{productId} on the downstream service. Ocelot will now just pass 5 to the fake service and it will return its response. |
I should have done it in the PR #89 but I didn´t notice. Sorry.
At this point the comparer must ignore case sensitive. It´s important for the proper functioning.