Skip to content

Commit

Permalink
Merge pull request #1262 from mhils/fix-header-name
Browse files Browse the repository at this point in the history
Fix TE header name in error message
  • Loading branch information
mhils authored Sep 14, 2021
2 parents b7dd09c + 16ecfbf commit a8fe33b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/h2/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def _reject_te(headers, hdr_validation_flags):
if header[0] in (b'te', u'te'):
if header[1].lower() not in (b'trailers', u'trailers'):
raise ProtocolError(
"Invalid value for Transfer-Encoding header: %s" %
"Invalid value for TE header: %s" %
header[1]
)

Expand Down
4 changes: 2 additions & 2 deletions test/test_invalid_headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@ def test_headers_event_skipping_validation(self, frame_factory, headers):
request_event = events[0]
assert request_event.headers == headers

def test_transfer_encoding_trailers_is_valid(self, frame_factory):
def test_te_trailers_is_valid(self, frame_factory):
"""
Transfer-Encoding trailers is allowed by the filter.
`te: trailers` is allowed by the filter.
"""
headers = (
self.base_request_headers + [('te', 'trailers')]
Expand Down

0 comments on commit a8fe33b

Please sign in to comment.