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

2017-02-04 Thread Guillaume Boudreau

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 
<http://bugs.python.org/issue29445>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2017-02-04 Thread Guillaume Boudreau

Guillaume Boudreau added the comment:

Yes, indeed. The latest patch in 24363 resolves this issue.
Sorry for the duplicate.

--

___
Python tracker 
<http://bugs.python.org/issue29445>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24363] httplib fails to handle semivalid HTTP headers

2017-02-07 Thread Guillaume Boudreau

Guillaume Boudreau added the comment:

Any chance this could get reviewed and merged soon? I got hit by a similar 
issue (see #29445) where the server, which I don't control, sends me invalid 
HTTP headers, and the prevents all the headers that follow it to not be parsed.
The latest attached patch fixed the issue for me.
Thanks.

--
nosy: +gboudreau

___
Python tracker 
<http://bugs.python.org/issue24363>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com