summaryrefslogtreecommitdiffstats
path: root/Lib/urllib
diff options
context:
space:
mode:
authorSenthil Kumaran <orsenthil@gmail.com>2010-07-11 03:12:43 (GMT)
committerSenthil Kumaran <orsenthil@gmail.com>2010-07-11 03:12:43 (GMT)
commit2ef16328e82ae9b9715251e41b8abf4b95ae6f20 (patch)
tree41c2f9303f4eb6efc9313044b1a54728fc2160c1 /Lib/urllib
parent0d62f5bbfe1c865165fd1285bb44fa29eb3b8bde (diff)
downloadcpython-2ef16328e82ae9b9715251e41b8abf4b95ae6f20.zip
cpython-2ef16328e82ae9b9715251e41b8abf4b95ae6f20.tar.gz
cpython-2ef16328e82ae9b9715251e41b8abf4b95ae6f20.tar.bz2
Stricter verification for file based url scheme and reliance on ftp protocol.
Diffstat (limited to 'Lib/urllib')
-rw-r--r--Lib/urllib/request.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
index f7c7416..c6767d0 100644
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -1188,7 +1188,8 @@ class FileHandler(BaseHandler):
# Use local file or FTP depending on form of URL
def file_open(self, req):
url = req.selector
- if url[:2] == '//' and url[2:3] != '/':
+ if url[:2] == '//' and url[2:3] != '/' and (req.host and
+ req.host != 'localhost'):
req.type = 'ftp'
return self.parent.open(req)
else: