Skip to content
Myr

cleanup shitty code

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

authored by Kenneth Reitz · committed by Kenneth Reitz · parent f1893c8 · Browse files · 1 file+9 added−11 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+9 added−11 removed

  • other:+9 added−11 removed

1 file+9 added−11 removed

modified:requests/sessions.py+9 added-11 removed
151 unmodified lines
152 del headers['Cookie']153 except KeyError:154 pass155156 extract_cookies_to_jar(prepared_request._cookies,157 prepared_request, resp.raw)156 extract_cookies_to_jar(prepared_request._cookies, prepared_request, resp.raw)157 prepared_request._cookies.update(self.cookies)158 prepared_request.prepare_cookies(prepared_request._cookies)159160 if 'Authorization' in headers:161 # 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)161 # 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 and167 'Authorization' in headers):168 del headers['Authorization']166 if (original_parsed.hostname != redirect_parsed.hostname):167 del headers['Authorization']168170 # However, .netrc might have more auth for us. Let's get it if it171 # does.169 # .netrc might have more auth for us.170 new_auth = get_netrc_auth(url) if self.trust_env else None171 if new_auth is not None:172 prepared_request.prepare_auth(new_auth)173
393 unmodified lines