aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/http/server.py
diff options
context:
space:
mode:
authorJeremy Cline <jeremycline@linux.microsoft.com>2025-06-15 01:34:29 -0400
committerGitHub <noreply@github.com>2025-06-15 06:34:29 +0100
commit2bd3895fcabb2dfdae5c0c72e60483e3d3267f0f (patch)
treedfae694fa3c2bebc8e4d238e0215a22f372307a6 /Lib/http/server.py
parent8979d3afe376c67931665070a79f6939ebcd940b (diff)
downloadcpython-2bd3895fcabb2dfdae5c0c72e60483e3d3267f0f.tar.gz
cpython-2bd3895fcabb2dfdae5c0c72e60483e3d3267f0f.zip
gh-127319: Disable port reuse on HTTP, XMLRPC, and logging TCP servers (GH-135405)
Prior to issue #120485 these servers did not allow port reuse, which makes sense as the behavior of port reuse is surprising if you're not expecting it. It's unclear to me why these services were switched to allow port reuse, but I believe the desired behavior (unless subclasses opt in) is to not allow port reuse. See also: https://bugzilla.redhat.com/show_bug.cgi?id=2323170
Diffstat (limited to 'Lib/http/server.py')
-rw-r--r--Lib/http/server.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/http/server.py b/Lib/http/server.py
index ef10d185932..a2ffbe2e44d 100644
--- a/Lib/http/server.py
+++ b/Lib/http/server.py
@@ -115,7 +115,7 @@ DEFAULT_ERROR_CONTENT_TYPE = "text/html;charset=utf-8"
class HTTPServer(socketserver.TCPServer):
allow_reuse_address = True # Seems to make sense in testing environment
- allow_reuse_port = True
+ allow_reuse_port = False
def server_bind(self):
"""Override server_bind to store the server name."""