From ce6e06874b235f7825888c20fd2c6f4670a4aeba Mon Sep 17 00:00:00 2001 From: Martin Panter Date: Mon, 16 May 2016 01:07:13 +0000 Subject: Issue #14132: Fix redirect handling when target is just a query string --- Lib/urllib/request.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Lib/urllib/request.py') diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py index 5f40729fca..bbd2bdf685 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) -- cgit v1.2.1