Skip to content
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

wsgiref doesn't appear to ever set REMOTE_HOST in the environ #66425

Closed
alex opened this issue Aug 19, 2014 · 3 comments
Closed

wsgiref doesn't appear to ever set REMOTE_HOST in the environ #66425

alex opened this issue Aug 19, 2014 · 3 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@alex
Copy link
Member

alex commented Aug 19, 2014

BPO 22229
Nosy @pjeby, @alex, @berkerpeksag, @isidentical

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 = None
closed_at = None
created_at = <Date 2014-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 = <Date 2019-11-18.22:03:20.358>
user = 'https://github.com/alex'

bugs.python.org fields:

activity = <Date 2019-11-18.22:03:20.358>
actor = 'BTaskaya'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2014-08-19.17:34:05.563>
creator = 'alex'
dependencies = []
files = []
hgrepos = []
issue_num = 22229
keywords = []
message_count = 2.0
messages = ['225534', '356918']
nosy_count = 4.0
nosy_names = ['pje', 'alex', 'berker.peksag', 'BTaskaya']
pr_nums = []
priority = 'normal'
resolution = None
stage = 'needs patch'
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue22229'
versions = ['Python 3.4', 'Python 3.5']

Linked PRs

@alex
Copy link
Member Author

alex commented 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_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.

@alex alex added the stdlib Python modules in the Lib dir label Aug 19, 2014
@berkerpeksag berkerpeksag added the type-bug An unexpected behavior, bug, or error label Aug 20, 2014
@isidentical
Copy link
Sponsor Member

I didn't understand the issue. WSGIRequestHandler can be subclassed and address_string method may return something else.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
c-bata added a commit to c-bata/cpython that referenced this issue Oct 29, 2023
@corona10
Copy link
Member

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

iritkatriel pushed a commit to iritkatriel/cpython that referenced this issue Oct 29, 2023
FullteaR pushed a commit to FullteaR/cpython that referenced this issue Nov 3, 2023
aisk pushed a commit to aisk/cpython that referenced this issue Feb 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

4 participants