Add a default list of headers to strip as a global
MODIFY
urllib3/util/retry.py
urllib3/util/retry.py
@@ -19,6 +19,10 @@ from ..packages import six
log = logging.getLogger(__name__)
+
+DEFAULT_REDIRECT_HEADERS_BLACKLIST = ['Authorization']
+
+
# Data structure for representing the metadata of requests that result in a retry.
RequestHistory = namedtuple('RequestHistory', ["method", "url", "error",
"status", "redirect_location"])
@@ -169,7 +173,7 @@ class Retry(object):
raise_on_redirect = False
if remove_headers_on_redirect is None:
- remove_headers_on_redirect = ['Authorization']
+ remove_headers_on_redirect = DEFAULT_REDIRECT_HEADERS_BLACKLIST
remove_headers_on_redirect = set(remove_headers_on_redirect)
self.redirect = redirect

Add a default list of headers to strip as a global