diff --git a/included_dependencies/urllib3/_version.py b/included_dependencies/urllib3/_version.py index 2dba29e3..97f83dc2 100644 --- a/included_dependencies/urllib3/_version.py +++ b/included_dependencies/urllib3/_version.py @@ -1,2 +1,2 @@ # This file is protected via CODEOWNERS -__version__ = "1.26.2" +__version__ = "1.26.3" diff --git a/included_dependencies/urllib3/connection.py b/included_dependencies/urllib3/connection.py index 660d679c..9066e6ad 100644 --- a/included_dependencies/urllib3/connection.py +++ b/included_dependencies/urllib3/connection.py @@ -67,7 +67,7 @@ port_by_scheme = {"http": 80, "https": 443} # When it comes time to update this value as a part of regular maintenance # (ie test_recent_date is failing) update it to ~6 months before the current date. -RECENT_DATE = datetime.date(2019, 1, 1) +RECENT_DATE = datetime.date(2020, 7, 1) _CONTAINS_CONTROL_CHAR_RE = re.compile(r"[^-!#$%&'*+.^_`|~0-9a-zA-Z]") @@ -215,7 +215,7 @@ class HTTPConnection(_HTTPConnection, object): def putheader(self, header, *values): """""" - if SKIP_HEADER not in values: + if not any(isinstance(v, str) and v == SKIP_HEADER for v in values): _HTTPConnection.putheader(self, header, *values) elif six.ensure_str(header.lower()) not in SKIPPABLE_HEADERS: raise ValueError( diff --git a/included_dependencies/urllib3/exceptions.py b/included_dependencies/urllib3/exceptions.py index d69958d5..cba6f3f5 100644 --- a/included_dependencies/urllib3/exceptions.py +++ b/included_dependencies/urllib3/exceptions.py @@ -289,7 +289,17 @@ class ProxySchemeUnknown(AssertionError, URLSchemeUnknown): # TODO(t-8ch): Stop inheriting from AssertionError in v2.0. def __init__(self, scheme): - message = "Not supported proxy scheme %s" % scheme + # 'localhost' is here because our URL parser parses + # localhost:8080 -> scheme=localhost, remove if we fix this. + if scheme == "localhost": + scheme = None + if scheme is None: + message = "Proxy URL had no scheme, should start with http:// or https://" + else: + message = ( + "Proxy URL had unsupported scheme %s, should use http:// or https://" + % scheme + ) super(ProxySchemeUnknown, self).__init__(message)