summaryrefslogtreecommitdiff
path: root/Lib/urllib.py
diff options
context:
space:
mode:
authorguido@google.com <guido@google.com>2011-03-24 10:44:17 -0700
committerguido@google.com <guido@google.com>2011-03-24 10:44:17 -0700
commit2bc23b8448394e96d5562fcc7b69aa54bb2c1a38 (patch)
tree6f149cc6725aec4b9ec8bbdd72d7c93d351c14b7 /Lib/urllib.py
parent60a4a90c8dd2972eb4bb977e70835be9593cbbac (diff)
downloadcpython-git-2bc23b8448394e96d5562fcc7b69aa54bb2c1a38.tar.gz
Add FTP to the allowed url schemes. Add Misc/NEWS.
Diffstat (limited to 'Lib/urllib.py')
-rw-r--r--Lib/urllib.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/urllib.py b/Lib/urllib.py
index 09ce8c57e8..b835f52f23 100644
--- a/Lib/urllib.py
+++ b/Lib/urllib.py
@@ -643,10 +643,11 @@ class FancyURLopener(URLopener):
newurl = basejoin(self.type + ":" + url, newurl)
# For security reasons we do not allow redirects to protocols
- # other than HTTP or HTTPS.
+ # other than HTTP, HTTPS or FTP.
newurl_lower = newurl.lower()
if not (newurl_lower.startswith('http://') or
- newurl_lower.startswith('https://')):
+ newurl_lower.startswith('https://') or
+ newurl_lower.startswith('ftp://')):
return
void = fp.read()