You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
http.client: missing response headers when malformed header is part of the response #73631
bpo-24363: httplib fails to handle semivalid HTTP headers
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=Noneclosed_at=<Date2017-02-04.20:58:55.818>created_at=<Date2017-02-04.20:29:53.415>labels= ['type-bug', 'library']
title='http.client: missing response headers when malformed header is part of the response'updated_at=<Date2017-02-05.00:10:37.824>user='https://github.com/gboudreau'
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.
Activity
gboudreau commentedon Feb 4, 2017
Tested using urllib3 1.20
I'm pretty sure the problem is caused by an invalid HTTP header returned by the server:
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.headersobject (HTTPMessage) shows all headers in_payload, but only theDateheader in_headers.Thus why I think this is a http.client issue, and not a urllib3 issue.
bitdancer commentedon Feb 4, 2017
This appears to be a duplicate of bpo-24363. Does the patch there fix the problem for you?
gboudreau commentedon Feb 5, 2017
Yes, indeed. The latest patch in 24363 resolves this issue.
Sorry for the duplicate.