hexo-server icon indicating copy to clipboard operation
hexo-server copied to clipboard

Query part of URL is not preserved across redirects

Open 17320 opened this issue 6 years ago • 0 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

  1. Have a resource such as /some/path/index.html
  2. Start hexo-server
  3. 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.

17320 avatar Oct 05 '18 10:10 17320