hexojs / hexo-server

Server module for Hexo.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Query part of URL is not preserved across redirects

17320 opened this issue · comments

commented

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.