Skip to content
Myr

Remove sharing of base_headers config between sessions.

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

Since base_headers is a dictionary, it's reference was shared with all instances of Session objects. Using deepcopy here should not incur large performance penalty.

authored by Suraj Barkale · committed by Suraj Barkale · parent 763393f · Browse files · 1 file+2 added−1 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+2 added−1 removed

  • other:+2 added−1 removed

1 file+2 added−1 removed

modified:requests/sessions.py+2 added-1 removed
7 unmodified lines
8requests (cookies, auth, proxies).910"""1112from copy import deepcopy13from .compat import cookielib14from .cookies import cookiejar_from_dict, remove_cookie_by_name15from .defaults import defaults16from .models import Request
64 unmodified lines
81 self.verify = verify82 self.cert = cert8384 for (k, v) in list(defaults.items()):84 self.config.setdefault(k, v)85 self.config.setdefault(k, deepcopy(v))8687 self.init_poolmanager()8889 # Set up a CookieJar to be used by default
235 unmodified lines