Closed Eilon closed 7 years ago
@mikaelm12 does some lower-level component do some canonicalization before we even get to it?
cc @blowdart in case there are some security concerns here about who should canonicalize what.
There ought to be a raw URL that rewrite works on, but generally this should be normalised in the Request classes that everything else uses.
I think it's IIS that removes these slashes. Then it wouldn't even show up in the original url (as received by Kestrel). @mikaelm12 to verify.
@Tratcher yeah that's what I was thinking.
@mikaelm12 could you take a look?
IIS is removing the slashes. So it's not that the middleware isn't identifying multiple slashes, the url it gets doesn't have them. You shouldn't see this if you don't run behind IIS.
From @parmarnishant on February 10, 2017 6:16
Problem : Redirect to url with single slash if url has multiple slashes.
http://localhost/segment1///segment2//segment3
The above url when read removes multiple slashes and shows only one slash. I tried following methods to read url.
request.Path Microsoft.AspNetCore.Http.Extensions.UriHelper.GetEncodedUri (request) Microsoft.AspNetCore.Http.Extensions.UriHelper.GetDisplayUri(request)
Thanks.
Copied from original issue: aspnet/Mvc#5779