Skip to content

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

Closed

Description

@alex
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

Activity

  1. alex commented on Aug 19, 2014

    @alex
    MemberAuthor

    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.

  2. added
    stdlibStandard Library Python modules in the Lib/ directory
    on Aug 19, 2014
  3. isidentical commented on Nov 18, 2019

    @isidentical
    SponsorMember

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

  4. transferred this issue fromon Apr 10, 2022
  5. added a commit that references this issue on Oct 29, 2023
  6. added a commit that references this issue on Oct 29, 2023
  7. corona10 commented on Oct 29, 2023

    @corona10
    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

  8. added a commit that references this issue on Oct 29, 2023
  9. added a commit that references this issue on Nov 3, 2023
  10. added a commit that references this issue on Feb 11, 2024
  11. added a commit that references this issue on Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions