Browser stripes encode dot character from url

I have a web application that allows searching. So when I go to somedomain.com/search/<QUERY>

, it looks for objects according to <QUERY>

. The problem is when I try to search for .

or ..

, it doesn't work as expected (which is pretty obvious). What surprised me is that if I manually enter the URL somedomain.com/search/%2E

, the browser (verified by Chrome and IE11) converts it somedomain.com/search/

and issues the request without the required payload.

So far, I haven't found anything that says it can't be done, so I came here. Right now I only have one option: replace .

and ..

with something like __dotPlaceholder__

, but that seems like a dirty hack to me.

Any solution (js or non-js) would be welcome. Any information as to why browsers strip URL-encoded dots is nice too.

+3


source to share


1 answer


Unfortunately, part of RFC3986 defines URI dot segments that should be normalized and removed in this case, i.e. http://example.com/a/./

, to becomehttp://example.com/a



see https://tools.ietf.org/html/rfc3986#page-33 for more information

+3


source







All Articles