]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-66425: Remove the unreachable code to set `REMOTE_HOST` header (gh-111441)
authorc-bata <c-bata@users.noreply.github.com>
Sun, 29 Oct 2023 04:56:15 +0000 (13:56 +0900)
committerGitHub <noreply@github.com>
Sun, 29 Oct 2023 04:56:15 +0000 (13:56 +0900)
Lib/wsgiref/simple_server.py
Misc/NEWS.d/next/Library/2023-10-29-03-46-27.gh-issue-66425.FWTdDo.rst [new file with mode: 0644]

index 93d01a863adf59e4dcf2e23d65e025526c273e6e..a0f2397fcf0006430534324fe679de3c78491ffa 100644 (file)
@@ -84,10 +84,6 @@ class WSGIRequestHandler(BaseHTTPRequestHandler):
 
         env['PATH_INFO'] = urllib.parse.unquote(path, 'iso-8859-1')
         env['QUERY_STRING'] = query
-
-        host = self.address_string()
-        if host != self.client_address[0]:
-            env['REMOTE_HOST'] = host
         env['REMOTE_ADDR'] = self.client_address[0]
 
         if self.headers.get('content-type') is None:
diff --git a/Misc/NEWS.d/next/Library/2023-10-29-03-46-27.gh-issue-66425.FWTdDo.rst b/Misc/NEWS.d/next/Library/2023-10-29-03-46-27.gh-issue-66425.FWTdDo.rst
new file mode 100644 (file)
index 0000000..e7ede35
--- /dev/null
@@ -0,0 +1,3 @@
+Remove the code to set the REMOTE_HOST header from wsgiref module,
+as it is unreachable. This header is used for performance reasons,
+which is not necessary in the wsgiref module.