summaryrefslogtreecommitdiff
path: root/Lib/pydoc.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2014-09-17 13:17:58 +0800
committerGeorg Brandl <georg@python.org>2014-09-17 13:17:58 +0800
commit0840b415829f7fab8db48e1b38bbbfc7da2df8c0 (patch)
treeea5d59d67f9a4800575b981c482de83def2a2400 /Lib/pydoc.py
parentdad182c16e6c9d10267a659bd376ba3d10affd4f (diff)
downloadcpython-git-0840b415829f7fab8db48e1b38bbbfc7da2df8c0.tar.gz
Issue #22421 - Secure pydoc server run. Bind it to localhost instead of all interfaces.
Diffstat (limited to 'Lib/pydoc.py')
-rwxr-xr-xLib/pydoc.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index fa02edaffc..2a0cbf341c 100755
--- a/Lib/pydoc.py
+++ b/Lib/pydoc.py
@@ -2431,8 +2431,8 @@ def _start_server(urlhandler, port):
class DocServer(http.server.HTTPServer):
def __init__(self, port, callback):
- self.host = (sys.platform == 'mac') and '127.0.0.1' or 'localhost'
- self.address = ('', port)
+ self.host = 'localhost'
+ self.address = (self.host, port)
self.callback = callback
self.base.__init__(self, self.address, self.handler)
self.quit = False