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: HTTP check lowercase response from proxy
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.8, Python 3.7, Python 3.6, Python 3.4, Python 3.5, Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: alvaromunoz, benjamin.peterson
Priority: normal Keywords:

Created on 2017-10-05 13:52 by alvaromunoz, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 3870 closed alvaromunoz, 2017-10-05 13:51
Messages (2)
msg303768 - (view) Author: Álvaro Muñoz (alvaromunoz) * Date: 2017-10-05 13:51
Recently faced an issue with a proxy responding in lowercase http, which caused this:

ProtocolError('Connection aborted.', BadStatusLine('http/1.1 200 connection established\r\n',))

Changing the string to uppercase before checking if it starts with HTTP fixes this issue and allows to use this proxy.

I know that the proxy is at fault here, but seeing as other applications (web browsers, office suite, text editors, etc.) still work behind this proxy, I think it might be a reasonable fix to have...
msg325039 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2018-09-11 17:53
The spec, https://tools.ietf.org/html/rfc7230#section-2.6, is quite clear that the HTTP version is case sensitive. In practice, not every client is lax. Firefox does a case-insensitive comparison, but libcurl requires uppercase. That makes me think we can safely stay strict.
History
Date User Action Args
2022-04-11 14:58:53adminsetgithub: 75885
2018-09-11 17:53:47benjamin.petersonsetstatus: open -> closed

nosy: + benjamin.peterson
messages: + msg325039

resolution: not a bug
stage: resolved
2017-10-05 13:52:00alvaromunozcreate