https://github.com/tornadoweb/tornado/pull/3451#discussion_r1894148653
# should match the invalid characters from
# https://www.rfc-editor.org/rfc/rfc9110#name-field-values
illegal_chars = [chr(o) for o in range(0, 0x20)]
+ illegal_chars.append(chr(0x7f))
illegal_chars.remove('\t')
for char in illegal_chars:
try:
if name in self._headers:
del self._headers[name]
- _INVALID_HEADER_CHAR_RE = re.compile(r"[\x00-\x08\x0a-\x1f]")
+ _INVALID_HEADER_CHAR_RE = re.compile(r"[\x00-\x08\x0a-\x1f\x7f]")
def _convert_header_value(self, value: _HeaderTypes) -> str:
# Convert the input value to a str. This type check is a bit