Skip to content

Commit

Permalink
ProxyConnector auth added
Browse files Browse the repository at this point in the history
  • Loading branch information
popravich committed Jun 18, 2014
1 parent 043439f commit 8edee57
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions aiohttp/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,11 @@ def _create_connection(self, req, **kwargs):
proxy_req = ClientRequest('GET', self.proxy,
headers={'Host': req.host})

if proxy_req.auth:
auth = proxy_req.headers['AUTHORIZATION']
del proxy_req.headers['AUTHORIZATION']
req.headers['PROXY-AUTHORIZATION'] = auth
proxy_req.headers['PROXY-AUTHORIZATION'] = auth
try:
transport, proto = yield from super()._create_connection(proxy_req)
except OSError:
Expand Down

0 comments on commit 8edee57

Please sign in to comment.