summaryrefslogtreecommitdiff
path: root/requests
diff options
context:
space:
mode:
authorNate Prewitt <Nate.Prewitt@gmail.com>2019-09-19 07:34:55 -0700
committerNate Prewitt <Nate.Prewitt@gmail.com>2019-09-19 07:42:23 -0700
commit09fd857eb1448a8234e39bc39e2c795d4c980bfb (patch)
treec853ab1de76bf50cc2079ec6adbc759da4c3515d /requests
parent146291795130cbe73e2a64f53c2a819244a4bd6b (diff)
downloadpython-requests-09fd857eb1448a8234e39bc39e2c795d4c980bfb.tar.gz
Revert "Add trusted domains"
This reverts commit fbe48fbb7c5b96cde3a16453311e45f723516afd.
Diffstat (limited to 'requests')
-rw-r--r--requests/sessions.py9
1 files changed, 1 insertions, 8 deletions
diff --git a/requests/sessions.py b/requests/sessions.py
index 6d51820c..cd8a8ae6 100644
--- a/requests/sessions.py
+++ b/requests/sessions.py
@@ -95,10 +95,6 @@ def merge_hooks(request_hooks, session_hooks, dict_class=OrderedDict):
class SessionRedirectMixin(object):
- def __init__(self):
- #: A list of domains that will be excluded from auth stripping
- self.trusted_domains = []
-
def get_redirect_target(self, resp):
"""Receives a Response. Returns a redirect URI or ``None``"""
# Due to the nature of how requests processes redirects this method will
@@ -124,8 +120,7 @@ class SessionRedirectMixin(object):
"""Decide whether Authorization header should be removed when redirecting"""
old_parsed = urlparse(old_url)
new_parsed = urlparse(new_url)
- if (old_parsed.hostname != new_parsed.hostname
- and new_parsed.hostname not in self.trusted_domains):
+ if old_parsed.hostname != new_parsed.hostname:
return True
# Special case: allow http -> https redirect when using the standard
# ports. This isn't specified by RFC 7235, but is kept to avoid
@@ -419,8 +414,6 @@ class Session(SessionRedirectMixin):
self.mount('https://', HTTPAdapter())
self.mount('http://', HTTPAdapter())
- super().__init__()
-
def __enter__(self):
return self