diff options
Diffstat (limited to 'Lib/urllib2.py')
| -rw-r--r-- | Lib/urllib2.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/urllib2.py b/Lib/urllib2.py index 0bb69a0..a537d36 100644 --- a/Lib/urllib2.py +++ b/Lib/urllib2.py @@ -561,7 +561,10 @@ class HTTPRedirectHandler(BaseHandler): if not (newurl_lower.startswith('http://') or newurl_lower.startswith('https://') or newurl_lower.startswith('ftp://')): - return + raise HTTPError(newurl, code, + msg + " - Redirection to url '%s' is not allowed" % + newurl, + headers, fp) # XXX Probably want to forget about the state of the current # request, although that might interact poorly with other |
