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.

Author sicarius
Recipients sicarius
Date 2020-11-22.09:59:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1606039194.24.0.479620011525.issue42432@roundup.psfhosted.org>
In-reply-to
Content
Hey,
BadStatusLine triggered when protocol version is in lowercase. 
I've encountered a server that answers "Http/1.0  404 Not Found\r\n" instead of "HTTP/1.0  404 Not Found\r\n"

## Expected Result

Requests understanding the status line.

## Actual Result

Requests is closing the connection.

## Reproduction Steps
### Setup a server that answers the line above
bash: ```while 1;do echo "Http/1.0  404 Not Found\r\n" | sudo nc -lnvp 80; done```
### get the server
```python
import requests
req = req = requests.get("http://127.0.0.1/", verify=False, allow_redir=False )
```

## problem location
Look at line 287 of http/client.py
the word "HTTP" should be matched in lowercase too.
```python
if not version.startswith("HTTP/"):```

Regards.
History
Date User Action Args
2020-11-22 09:59:54sicariussetrecipients: + sicarius
2020-11-22 09:59:54sicariussetmessageid: <1606039194.24.0.479620011525.issue42432@roundup.psfhosted.org>
2020-11-22 09:59:54sicariuslinkissue42432 messages
2020-11-22 09:59:53sicariuscreate