summaryrefslogtreecommitdiffstats
path: root/Lib/urllib
diff options
context:
space:
mode:
authorSenthil Kumaran <senthil@uthcode.com>2012-01-04 05:46:59 (GMT)
committerSenthil Kumaran <senthil@uthcode.com>2012-01-04 05:46:59 (GMT)
commit6497aa3e00162752ebfae20e3e62a67e796d7630 (patch)
treeb7306528f32254c3b467b16d47c65dd4f1ddc272 /Lib/urllib
parentb7ffed8a506a6a98e59e5f23bd6d4fe706b40bc3 (diff)
downloadcpython-6497aa3e00162752ebfae20e3e62a67e796d7630.zip
cpython-6497aa3e00162752ebfae20e3e62a67e796d7630.tar.gz
cpython-6497aa3e00162752ebfae20e3e62a67e796d7630.tar.bz2
Issue13696 - Fix 302 Redirection for Relative urls.
Diffstat (limited to 'Lib/urllib')
-rw-r--r--Lib/urllib/request.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
index b41dd7e..77b7c7f 100644
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -552,7 +552,7 @@ class HTTPRedirectHandler(BaseHandler):
# For security reasons we don't allow redirection to anything other
# than http, https or ftp.
- if urlparts.scheme not in ('http', 'https', 'ftp'):
+ if urlparts.scheme not in ('http', 'https', 'ftp', ''):
raise HTTPError(
newurl, code,
"%s - Redirection to url '%s' is not allowed" % (msg, newurl),
@@ -1935,7 +1935,7 @@ class FancyURLopener(URLopener):
# We are using newer HTTPError with older redirect_internal method
# This older method will get deprecated in 3.3
- if urlparts.scheme not in ('http', 'https', 'ftp'):
+ if urlparts.scheme not in ('http', 'https', 'ftp', ''):
raise HTTPError(newurl, errcode,
errmsg +
" Redirection to url '%s' is not allowed." % newurl,