1
0
mirror of https://github.com/apache/httpd.git synced 2026-10-23 22:49:01 +03:00

Prevent 'f-string expression part cannot include a backslash'

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1938417 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Rainer Jung
2026-09-22 07:53:09 +00:00
parent 527cbd67e5
commit d4d8d3a942

View File

@@ -107,8 +107,10 @@ class TestStatusLineCR:
f"bare CR in status line: {status_line!r}"
assert b"X-Foobar" not in status_line, \
f"attacker text in status line: {status_line!r}"
# Prevent 'f-string expression part cannot include a backslash'
hide_backslash = b'\\r\\n\\r\\n'
assert b"X-Foobar" not in raw.split(b"\r\n\r\n")[0], \
f"injected header in response headers: {raw.split(b'\\r\\n\\r\\n')[0]!r}"
f"injected header in response headers: {raw.split(hide_backslash)[0]!r}"
env.httpd_error_log.ignore_recent(
lognos=["AH00957", "AH01106", "AH01114"]