Add tests for the urllib[2] vulnerability. Change to raise exceptions.
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 @@
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