Fix localhost checking in FileHandler. Raised in #21970.

This commit is contained in:
Senthil Kumaran 2014-07-22 00:15:20 -07:00
parent dfab935c74
commit bc07ac5180
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)