summaryrefslogtreecommitdiffstats
path: root/Lib/urllib/request.py
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-05-16 01:07:13 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2016-05-16 01:07:13 (GMT)
commitce6e06874b235f7825888c20fd2c6f4670a4aeba (patch)
treecbab88edff943bca30d70f2ec8622616636c01ba /Lib/urllib/request.py
parentf95455da4c3c61a302d62322a4bcb17a629efd4b (diff)
downloadcpython-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/request.py')
-rw-r--r--Lib/urllib/request.py2
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)