mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
Fix for Issue3819 - urllib2 sends Basic auth across redirects
This commit is contained in:
parent
2d9856d6ce
commit
8526adfbd9
2 changed files with 3 additions and 2 deletions
|
|
@ -839,7 +839,7 @@ class AbstractBasicAuthHandler:
|
|||
auth = 'Basic %s' % base64.b64encode(raw).strip()
|
||||
if req.headers.get(self.auth_header, None) == auth:
|
||||
return None
|
||||
req.add_header(self.auth_header, auth)
|
||||
req.add_unredirected_header(self.auth_header, auth)
|
||||
return self.parent.open(req, timeout=req.timeout)
|
||||
else:
|
||||
return None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue