NanoHttpd / nanohttpd

Tiny, easily embeddable HTTP server in Java.
http://nanohttpd.org
BSD 3-Clause "New" or "Revised" License
6.92k stars 1.69k forks source link

Plus signs in URL path should NOT be replaced with spaces #537

Open quartzsaber opened 5 years ago

quartzsaber commented 5 years ago

Plus signs in query string is expected to be replaced with spaces. However, it it not the case for path. Please look at example below.

http://example.com/foo+bar.html should open foo+bar.html http://example.com/foo%20bar.html should open foo bar.html http://example.com/foo+bar?key=val+val should open foo+bar with key=val val

NanoHTTPD currently treats http://example.com/foo+bar.html as http://example.com/foo bar.html, which is wrong according to RFC 1738.

For more information, please look at this SO answer.