This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: wsgiref doesn't appear to ever set REMOTE_HOST in the environ
Type: behavior Stage: needs patch
Components: Library (Lib) Versions: Python 3.4, Python 3.5
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: BTaskaya, alex, berker.peksag, pje
Priority: normal Keywords:

Created on 2014-08-19 17:34 by alex, last changed 2022-04-11 14:58 by admin.

Messages (2)
msg225534 - (view) Author: Alex Gaynor (alex) * (Python committer) Date: 2014-08-19 17:34
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_string` always returns `self.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.
msg356918 - (view) Author: Batuhan Taskaya (BTaskaya) * (Python committer) Date: 2019-11-18 22:03
I didn't understand the issue. WSGIRequestHandler can be subclassed and address_string method may return something else.
History
Date User Action Args
2022-04-11 14:58:07adminsetgithub: 66425
2019-11-18 22:03:20BTaskayasetnosy: + BTaskaya
messages: + msg356918
2014-08-20 13:30:32berker.peksagsetnosy: + pje, berker.peksag

type: behavior
stage: needs patch
2014-08-19 17:34:05alexcreate