[issue29445] http.client: missing response headers when malformed header is part of the response

Guillaume Boudreau report at bugs.python.org
Sat Feb 4 15:29:53 EST 2017


New submission from Guillaume Boudreau:

Tested using urllib3 1.20

```
>>> import urllib3
>>> http = urllib3.PoolManager()
>>> r = http.request('GET', 'https://online.chasecanada.ca/ChaseCanada_Consumer/Login.do')
>>> r.status
200
>>> r.headers
HTTPHeaderDict({'Date': 'Sat, 04 Feb 2017 20:09:21 GMT'})
>>>
```

I'm pretty sure the problem is caused by an invalid HTTP header returned by the server:

    HTTP/1.1 200 OK
    Date: Sat, 04 Feb 2017 19:16:34 GMT
    My Param: None
    [...]

It directly follows the Date response header, which is returned fine, but since no other response headers is returned, I think this broken header is breaking the HTTP response headers parser.

Of note: the `http.client.HTTPresponse.headers` object (`HTTPMessage`) shows all headers in `_payload`, but only the `Date` header in `_headers`.
Thus why I think this is a http.client issue, and not a urllib3 issue.

----------
components: Library (Lib)
messages: 286987
nosy: gboudreau
priority: normal
severity: normal
status: open
title: http.client: missing response headers when malformed header is part of the response
type: behavior
versions: Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29445>
_______________________________________


More information about the Python-bugs-list mailing list