mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #14132: Fix redirect handling when target is just a query string
This commit is contained in:
parent
f95455da4c
commit
ce6e06874b
4 changed files with 25 additions and 5 deletions
|
@ -652,7 +652,7 @@ class HTTPRedirectHandler(BaseHandler):
|
|||
"%s - Redirection to url '%s' is not allowed" % (msg, newurl),
|
||||
headers, fp)
|
||||
|
||||
if not urlparts.path:
|
||||
if not urlparts.path and urlparts.netloc:
|
||||
urlparts = list(urlparts)
|
||||
urlparts[2] = "/"
|
||||
newurl = urlunparse(urlparts)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue