Skip to content

Commit 44df66c

Browse files
committed
Fix perfect match missed for headers with empty values: add test and changelog
1 parent b466783 commit 44df66c

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ dev
1313

1414
- Support for Python 3.14 has been added.
1515
- Support for PyPy 3.11 has been added.
16+
- Fixed perfect match missed for headers with empty values
1617

1718
**Bugfixes**
1819

tests/test_hpack.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,18 @@ def test_indexed_header_field(self):
126126
assert e.encode(header_set, huffman=False) == result
127127
assert list(e.header_table.dynamic_entries) == []
128128

129+
def test_indexed_header_field_empty_value_string(self):
130+
"""
131+
The header field representation uses an indexed header field, from
132+
the static table.
133+
"""
134+
e = Encoder()
135+
header_set = {':authority': ''}
136+
result = b'\x81'
137+
138+
assert e.encode(header_set, huffman=False) == result
139+
assert list(e.header_table.dynamic_entries) == []
140+
129141
def test_indexed_header_field_from_static_table(self):
130142
e = Encoder()
131143
e.header_table_size = 0

0 commit comments

Comments
 (0)