cloudhead / node-static

rfc 2616 compliant HTTP static-file server module, with built-in caching.
MIT License
2.17k stars 245 forks source link

Query string is removed if the trailing slash is missing #186

Open harrygreen opened 7 years ago

harrygreen commented 7 years ago

After much head scratching, I noticed query strings are removed if the trailing slashes are missing from URLs. E.g.

http://localhost:8000/foo?x=123

automatically redirects to

http://localhost:8000/foo/

whereas I think it should retain the query, e.g.

http://localhost:8000/foo/?x=123

Python's SimpleHTTPServer does this.

Thanks!