Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Browser strips encoded dot character from url

I have a web app, which allows searching. So when I go to somedomain.com/search/<QUERY> it searches for entities 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 though, is that if I manually enter the url of somedomain.com/search/%2E, the browser (tested Chrome and IE11) converts it somedomain.com/search/ and issues a request without necessary payload.

So far I haven't found anything that would say it's not possible to make this work, so I came here. Right now I have only one option: replacing . and .. to something like __dotPlaceholder__, but this feels like a dirty hack to me.

Any solution (js or non-js) will be welcomed. Any information on why do browsers strip url-encoded dots is also a nice-to-have.

like image 907
Dethariel Avatar asked Sep 16 '25 22:09

Dethariel


1 Answers

Unfortunately part of RFC3986 defines the URI dot segments to be normalised and stripped out in that case, ie http://example.com/a/./ to become http://example.com/a

see https://www.rfc-editor.org/rfc/rfc3986#page-33 for more information

like image 186
99 Problems - Syntax ain't one Avatar answered Sep 19 '25 12:09

99 Problems - Syntax ain't one