diff options
author | Martin Panter <vadmium+py@gmail.com> | 2016-05-16 01:07:13 (GMT) |
---|---|---|
committer | Martin Panter <vadmium+py@gmail.com> | 2016-05-16 01:07:13 (GMT) |
commit | ce6e06874b235f7825888c20fd2c6f4670a4aeba (patch) | |
tree | cbab88edff943bca30d70f2ec8622616636c01ba /Lib/urllib | |
parent | f95455da4c3c61a302d62322a4bcb17a629efd4b (diff) | |
download | cpython-ce6e06874b235f7825888c20fd2c6f4670a4aeba.zip cpython-ce6e06874b235f7825888c20fd2c6f4670a4aeba.tar.gz cpython-ce6e06874b235f7825888c20fd2c6f4670a4aeba.tar.bz2 |
Issue #14132: Fix redirect handling when target is just a query string
Diffstat (limited to 'Lib/urllib')
-rw-r--r-- | Lib/urllib/request.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py index 5f40729..bbd2bdf 100644 --- a/Lib/urllib/request.py +++ b/Lib/urllib/request.py @@ -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) |