From 2396b68c7586f776fad24c71d3753493c6e94842 Mon Sep 17 00:00:00 2001 From: kmg0308 <113580700+kmg0308@users.noreply.github.com> Date: Mon, 29 Jun 2026 19:40:34 +0900 Subject: [PATCH] Fix Link header parameter parsing with equals signs --- src/requests/utils.py | 2 +- tests/test_utils.py | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/requests/utils.py b/src/requests/utils.py index fff6edf4be..4439dfe989 100644 --- a/src/requests/utils.py +++ b/src/requests/utils.py @@ -988,7 +988,7 @@ def parse_header_links(value: str) -> list[dict[str, str]]: for param in params.split(";"): try: - key, value = param.split("=") + key, value = param.split("=", 1) except ValueError: break diff --git a/tests/test_utils.py b/tests/test_utils.py index 091a9fd6f3..e582bc33f4 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -690,6 +690,17 @@ def test_iter_slices(value, length): {"url": "http://.../back.jpeg"}, ], ), + ( + '; rel="next"; title="A=B"; type="text/html"', + [ + { + "url": "https://example.com/?cursor=a=b", + "rel": "next", + "title": "A=B", + "type": "text/html", + } + ], + ), ("", []), ), )