Do not strip entity-headers.

This commit is contained in:
L. Kärkkäinen 2023-09-20 19:59:35 +01:00
parent 11c841ab4e
commit 875e921bda

View File

@ -106,9 +106,6 @@ class BaseHTTPResponse:
Returns: Returns:
Iterator[Tuple[bytes, bytes]]: A list of header tuples encoded in bytes for sending Iterator[Tuple[bytes, bytes]]: A list of header tuples encoded in bytes for sending
""" # noqa: E501 """ # noqa: E501
# TODO: Make a blacklist set of header names and then filter with that
if self.status in (304, 412): # Not Modified, Precondition Failed
self.headers = remove_entity_headers(self.headers)
if has_message_body(self.status): if has_message_body(self.status):
self.headers.setdefault("content-type", self.content_type) self.headers.setdefault("content-type", self.content_type)
# Encode headers into bytes # Encode headers into bytes