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", + } + ], + ), ("", []), ), )