Query part of URL is not preserved across redirects
17320 opened this issue · comments
When serving a request for /some/path
where the actual resource is /some/path/index.html
, the server performs an HTTP 302 redirect to /some/path/
, but in the process, it loses any query information the original URL might have had.
Recall that query parts may be used not just by the server but also by client-side Javascript.
Test case
- Have a resource such as
/some/path/index.html
- Start
hexo-server
- Request
/some/path?id=test
Expected result
The user is redirected to /some/path/?id=test
(assuming root is /
).
Actual result
The user is redirected to /some/path/
and the query information is lost.