mirror of
https://github.com/python/cpython.git
synced 2025-11-25 12:44:13 +00:00
Merged revisions 76908 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r76908 | senthil.kumaran | 2009-12-20 11:35:13 +0530 (Sun, 20 Dec 2009) | 4 lines Fix for issue 7291 - urllib2 cannot handle https with proxy requiring auth Refactored HTTPHandler tests and added testcase for proxy authorization. ........
This commit is contained in:
parent
2f4f2c15cb
commit
8116364b73
4 changed files with 99 additions and 34 deletions
|
|
@ -1120,7 +1120,14 @@ class AbstractHTTPHandler(BaseHandler):
|
|||
(name.title(), val) for name, val in headers.items())
|
||||
|
||||
if req._tunnel_host:
|
||||
h._set_tunnel(req._tunnel_host)
|
||||
tunnel_headers = {}
|
||||
proxy_auth_hdr = "Proxy-Authorization"
|
||||
if proxy_auth_hdr in headers:
|
||||
tunnel_headers[proxy_auth_hdr] = headers[proxy_auth_hdr]
|
||||
# Proxy-Authorization should not be sent to origin
|
||||
# server.
|
||||
del headers[proxy_auth_hdr]
|
||||
h._set_tunnel(req._tunnel_host, headers=tunnel_headers)
|
||||
|
||||
try:
|
||||
h.request(req.get_method(), req.get_selector(), req.data, headers)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue