Skip to content

gh-66425: Remove the unreachable code to set REMOTE_HOST header #111441

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions Lib/wsgiref/simple_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,6 @@ def get_environ(self):

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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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.