summaryrefslogtreecommitdiff
path: root/tests/utils_tests
diff options
context:
space:
mode:
authorNatalia <124304+nessita@users.noreply.github.com>2025-09-15 11:45:20 -0300
committernessita <124304+nessita@users.noreply.github.com>2025-09-15 22:14:50 -0300
commit424e0d86973d88b402b55f20884938715aad740b (patch)
tree0fb9a11c1f96494e15669da8ef48d8cbf9cedb02 /tests/utils_tests
parent0e0b4214c350da9b627a67987b13ec334e1de033 (diff)
Fixed #36520 -- Reverted "Fixed #35440 -- Simplified parse_header_parameters by leveraging stdlid's Message."
This partially reverts commit 9aabe7eae3eeb3e64c5a0f3687118cd806158550. The simplification of parse_header_parameters using stdlib's Message is reverted due to a performance regression. The check for the header maximum length remains in place, per Security Team guidance. Thanks to David Smith for reporting the regression, and Jacob Walls for the review.
Diffstat (limited to 'tests/utils_tests')
-rw-r--r--tests/utils_tests/test_http.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/utils_tests/test_http.py b/tests/utils_tests/test_http.py
index 95ec2fc516..58a4b40f3e 100644
--- a/tests/utils_tests/test_http.py
+++ b/tests/utils_tests/test_http.py
@@ -442,7 +442,7 @@ class ParseHeaderParameterTests(unittest.TestCase):
def test_basic(self):
tests = [
("", ("", {})),
- (None, ("none", {})),
+ (None, ("", {})),
("text/plain", ("text/plain", {})),
("text/vnd.just.made.this.up ; ", ("text/vnd.just.made.this.up", {})),
("text/plain;charset=us-ascii", ("text/plain", {"charset": "us-ascii"})),
@@ -507,13 +507,12 @@ class ParseHeaderParameterTests(unittest.TestCase):
"""
Test wrongly formatted RFC 2231 headers (missing double single quotes).
Parsing should not crash (#24209).
- But stdlib email still decodes (#35440).
"""
test_data = (
(
"Content-Type: application/x-stuff; "
"title*='This%20is%20%2A%2A%2Afun%2A%2A%2A",
- "'This is ***fun***",
+ "'This%20is%20%2A%2A%2Afun%2A%2A%2A",
),
("Content-Type: application/x-stuff; title*='foo.html", "'foo.html"),
("Content-Type: application/x-stuff; title*=bar.html", "bar.html"),