Skip to content
Myr

Repopulate ~/.netrc auth.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Cory Benfield · committed by Cory Benfield · parent b1c8fd3 · Browse files · 1 file+17 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+17 added−0 removed

  • other:+17 added−0 removed

1 file+17 added−0 removed

modified:requests/sessions.py+17 added
156 unmodified lines
157 prepared_request, resp.raw)158 prepared_request._cookies.update(self.cookies)159 prepared_request.prepare_cookies(prepared_request._cookies)160161 # If we get redirected to a new host, we should strip out any162 # authentication headers.163 original_parsed = urlparse(resp.request.url)164 redirect_parsed = urlparse(url)165166 if original_parsed.hostname != redirect_parsed.hostname:167 try:168 del headers['Authorization']169 except KeyError:170 pass171172 # However, .netrc might have more auth for us. Let's get it if it173 # does.174 new_auth = get_netrc_auth(url)175 if new_auth is not None:176 prepared_request.prepare_auth(new_auth)177178 resp = self.send(179 prepared_request,180 stream=stream,181 timeout=timeout,
389 unmodified lines