serve-handler
serve-handler copied to clipboard
Wrong redirect that cause wrong relative links interpolation on html files
it redirects urls like:
http://localhost:8000/abc/def/index.html
to http://localhost:8000/abc/def
if index.html
contains links like <a href="file.html">File</a>
browser resolves that links like:
http://localhost:8000/abc/file.html
instead of http://localhost:8000/abc/def/file.html
actual behaviour:
redirects http://localhost:8000/abc/def/index.html
to http://localhost:8000/abc/def
expected behaviour:
redirects http://localhost:8000/abc/def/index.html
to http://localhost:8000/abc/def/
I compared it to for example SimpleHTTPServer from python, and it works correctly.
You should try
- python -m http.server 8000
- open it on different browser
cleanUrls + trailingSlash is a dangerous combination of config options, which will break relative links