Merge 3.4

Fix localhost checking in FileHandler. Raised in #21970.
This commit is contained in:
Senthil Kumaran 2014-07-22 00:16:18 -07:00
commit 284a4a1bb0
2 changed files with 3 additions and 2 deletions

View file

@ -1315,7 +1315,7 @@ class FileHandler(BaseHandler):
url = req.selector
if url[:2] == '//' and url[2:3] != '/' and (req.host and
req.host != 'localhost'):
if not req.host is self.get_names():
if not req.host in self.get_names():
raise URLError("file:// scheme is supported only on localhost")
else:
return self.open_local_file(req)