Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
2a42a0bf
Commit
2a42a0bf
authored
Sep 17, 2014
by
Senthil Kumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #22421 - Secure pydoc server run. Bind it to localhost instead of all interfaces.
parent
7d0b8f95
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
Lib/pydoc.py
Lib/pydoc.py
+2
-2
Lib/test/test_pydoc.py
Lib/test/test_pydoc.py
+2
-0
No files found.
Lib/pydoc.py
View file @
2a42a0bf
...
...
@@ -2168,8 +2168,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
...
...
Lib/test/test_pydoc.py
View file @
2a42a0bf
...
...
@@ -557,6 +557,8 @@ class PydocServerTest(unittest.TestCase):
return
text
serverthread
=
pydoc
.
_start_server
(
my_url_handler
,
port
=
0
)
self
.
assertIn
(
'localhost'
,
serverthread
.
docserver
.
address
)
starttime
=
time
.
time
()
timeout
=
1
#seconds
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment