Message211387
| Author |
martin.panter |
| Recipients |
jcea, martin.panter, orsenthil, r.david.murray, sanxiago, shubhojeet.ghosh |
| Date |
2014年02月17日.02:32:27 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1392604348.68.0.71211436851.issue12849@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|