mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Fix localhost checking in FileHandler. Raised in #21970.
This commit is contained in:
parent
dfab935c74
commit
bc07ac5180
2 changed files with 3 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue