You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
wsgiref doesn't appear to ever set REMOTE_HOST in the environ #66425
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=Nonecreated_at=<Date2014-08-19.17:34:05.563>labels= ['type-bug', 'library']
title="wsgiref doesn't appear to ever set REMOTE_HOST in the environ"updated_at=<Date2019-11-18.22:03:20.358>user='https://github.com/alex'
Activity
alex commentedon Aug 19, 2014
Based on a reading of the code:
https://github.com/python/cpython/blob/master/Lib/wsgiref/simple_server.py#L88-L90
is where REMOTE_HOST is set.
However,
address_stringalways returnsself.client_address[0](https://github.com/python/cpython/blob/master/Lib/http/server.py#L568), which means that!=comparison always returns False, which means REMOTE_HOST is never actually set correctly.isidentical commentedon Nov 18, 2019
I didn't understand the issue. WSGIRequestHandler can be subclassed and address_string method may return something else.
pythongh-66425: Remove the unreachable code to set REMOTE_HOST header…
gh-66425: Remove the unreachable code to set `REMOTE_HOST` header (gh…
corona10 commentedon Oct 29, 2023
Merge the PR, Even if someone overrides WSGIRequestHandler there is the documentation that the user should care about: https://docs.python.org/3/library/wsgiref.html?highlight=wsgirequesthandler#wsgiref.simple_server.WSGIRequestHandler
pythongh-66425: Remove the unreachable code to set `REMOTE_HOST` head…
pythongh-66425: Remove the unreachable code to set `REMOTE_HOST` head…
pythongh-66425: Remove the unreachable code to set `REMOTE_HOST` head…
pythongh-66425: Remove the unreachable code to set `REMOTE_HOST` head…