This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: SimpleHTTPServer/http.server adds trailing slash after query string
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.4, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: artifex93, jpf, python-dev
Priority: normal Keywords:

Created on 2014-12-25 11:34 by jpf, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (2)
msg233095 - (view) Author: Josep Portella Florit (jpf) Date: 2014-12-25 11:34
To reproduce:

1) Create directory "foo" in the current directory.
2) Run "python -m SimpleHTTPServer" or "python3 -m http.server".
3A) Point web browser to "http://127.0.0.1:8000/foo/?".
    The request is redirected to "http://127.0.0.1:8000/foo/?/".
    The expected behaviour was no redirection.
3B) Point web browser to "http://127.0.0.1:8000/foo?".
    The request is redirected to "http://127.0.0.1:8000/foo?/".
    The expected behaviour was a redirection to
    "http://127.0.0.1:8000/foo/?".

Reproduced with 2.7.6 and 3.4.0.
msg233106 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-12-26 16:57
New changeset b058a904c630 by Benjamin Peterson in branch '2.7':
fix behavior of trailing slash redirection when a query string is involved (closes #23112)
https://hg.python.org/cpython/rev/b058a904c630

New changeset 3d19f419cc44 by Benjamin Peterson in branch '3.4':
fix behavior of trailing slash redirection when a query string is involved (closes #23112)
https://hg.python.org/cpython/rev/3d19f419cc44

New changeset e7c7e1fce3e2 by Benjamin Peterson in branch 'default':
merge 3.4 (#23112)
https://hg.python.org/cpython/rev/e7c7e1fce3e2
History
Date User Action Args
2022-04-11 14:58:11adminsetgithub: 67301
2017-11-26 03:59:48martin.panterlinkissue10231 superseder
2014-12-26 16:57:12python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg233106

resolution: fixed
stage: resolved
2014-12-26 13:21:27artifex93setnosy: + artifex93
2014-12-25 11:34:44jpfcreate