Martin Panter added the comment:
I suggest using setdefault() in urllib.request.AbstractHTTPHandler.do_open():
headers.setdefault("Connection", "close")
I am trying to work around a server that truncates its response when this
header is sent, and this change would allow me to specify
headers={"Connection", "Keep-Alive"} to get the same effect as dropping the
Connection header. This is also consistent with the way the other headers
(Accept-Encoding, User-Agent, Host) may be overridden.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue12849>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com