diff options
author | Senthil Kumaran <orsenthil@gmail.com> | 2011-03-19 09:45:40 (GMT) |
---|---|---|
committer | Senthil Kumaran <orsenthil@gmail.com> | 2011-03-19 09:45:40 (GMT) |
commit | d24c991f11541ccdb3cddade4a59ae0d2c0908bd (patch) | |
tree | 6572268789decab2443ae41d0bc09393cb5956e6 /Lib/urllib/request.py | |
parent | af9be06b3c82766110d9d4cc1e8bc3ad7fcfbf84 (diff) | |
parent | d91ffcafcb39a5426e73ce9ec4b15077662ec571 (diff) | |
download | cpython-d24c991f11541ccdb3cddade4a59ae0d2c0908bd.zip cpython-d24c991f11541ccdb3cddade4a59ae0d2c0908bd.tar.gz cpython-d24c991f11541ccdb3cddade4a59ae0d2c0908bd.tar.bz2 |
Merging it again.
Diffstat (limited to 'Lib/urllib/request.py')
-rw-r--r-- | Lib/urllib/request.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py index 1e437b5..4d3648d 100644 --- a/Lib/urllib/request.py +++ b/Lib/urllib/request.py @@ -1657,6 +1657,12 @@ class URLopener: headers["Authorization"] = "Basic %s" % auth if realhost: headers["Host"] = realhost + + # Add Connection:close as we don't support persistent connections yet. + # This helps in closing the socket and avoiding ResourceWarning + + headers["Connection"] = "close" + for header, value in self.addheaders: headers[header] = value |