Skip to content

Commit 5cbefb8

Browse files
committed
Upgrade urllib3 to 1.26.19
1 parent fb09703 commit 5cbefb8

File tree

7 files changed

+26
-27
lines changed

7 files changed

+26
-27
lines changed

newrelic/packages/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
# This file is used by dependabot to keep track of and recommend updates
44
# to the New Relic Python Agent's dependencies in newrelic/packages/.
55
opentelemetry_proto==1.0.0
6-
urllib3==1.26.18
6+
urllib3==1.26.19
77
wrapt==1.16.0
88
asgiref==3.6.0 # We only vendor asgiref.compatibility.py

newrelic/packages/urllib3/LICENSE.txt

Lines changed: 0 additions & 21 deletions
This file was deleted.

newrelic/packages/urllib3/__init__.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,22 @@
1919
from .util.timeout import Timeout
2020
from .util.url import get_host
2121

22+
# === NOTE TO REPACKAGERS AND VENDORS ===
23+
# Please delete this block, this logic is only
24+
# for urllib3 being distributed via PyPI.
25+
# See: https://github.com/urllib3/urllib3/issues/2680
26+
try:
27+
import urllib3_secure_extra # type: ignore # noqa: F401
28+
except ImportError:
29+
pass
30+
else:
31+
warnings.warn(
32+
"'urllib3[secure]' extra is deprecated and will be removed "
33+
"in a future release of urllib3 2.x. Read more in this issue: "
34+
"https://github.com/urllib3/urllib3/issues/2680",
35+
category=DeprecationWarning,
36+
stacklevel=2,
37+
)
2238

2339
__author__ = "Andrey Petrov ([email protected])"
2440
__license__ = "MIT"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# This file is protected via CODEOWNERS
2-
__version__ = "1.26.18"
2+
__version__ = "1.26.19"

newrelic/packages/urllib3/connection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class BrokenPipeError(Exception):
6868

6969
# When it comes time to update this value as a part of regular maintenance
7070
# (ie test_recent_date is failing) update it to ~6 months before the current date.
71-
RECENT_DATE = datetime.date(2022, 1, 1)
71+
RECENT_DATE = datetime.date(2024, 1, 1)
7272

7373
_CONTAINS_CONTROL_CHAR_RE = re.compile(r"[^-!#$%&'*+.^_`|~0-9a-zA-Z]")
7474

@@ -437,7 +437,7 @@ def connect(self):
437437
and self.ssl_version is None
438438
and hasattr(self.sock, "version")
439439
and self.sock.version() in {"TLSv1", "TLSv1.1"}
440-
):
440+
): # Defensive:
441441
warnings.warn(
442442
"Negotiating TLSv1/TLSv1.1 by default is deprecated "
443443
"and will be disabled in urllib3 v2.0.0. Connecting to "

newrelic/packages/urllib3/connectionpool.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,9 @@ def _is_ssl_error_message_from_http_proxy(ssl_error):
768768
# so we try to cover our bases here!
769769
message = " ".join(re.split("[^a-z]", str(ssl_error).lower()))
770770
return (
771-
"wrong version number" in message or "unknown protocol" in message
771+
"wrong version number" in message
772+
or "unknown protocol" in message
773+
or "record layer failure" in message
772774
)
773775

774776
# Try to detect a common user error with proxies which is to

newrelic/packages/urllib3/util/retry.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,9 @@ class Retry(object):
235235
RETRY_AFTER_STATUS_CODES = frozenset([413, 429, 503])
236236

237237
#: Default headers to be used for ``remove_headers_on_redirect``
238-
DEFAULT_REMOVE_HEADERS_ON_REDIRECT = frozenset(["Cookie", "Authorization"])
238+
DEFAULT_REMOVE_HEADERS_ON_REDIRECT = frozenset(
239+
["Cookie", "Authorization", "Proxy-Authorization"]
240+
)
239241

240242
#: Maximum backoff time.
241243
DEFAULT_BACKOFF_MAX = 120

0 commit comments

Comments
 (0)