Skip to content
This repository was archived by the owner on Jan 13, 2021. It is now read-only.

Commit 9e057bd

Browse files
committed
Correctly handle non-indexed HPACK fields.
1 parent 71e750d commit 9e057bd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

hyper/http20/hpack.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -598,13 +598,13 @@ def _decode_literal(self, data, should_index):
598598

599599
# When should_index is true, if the low six bits of the first byte are
600600
# nonzero, the header name is indexed.
601-
# When should_index is false, if the first byte is nonzero the header
602-
# name is indexed.
601+
# When should_index is false, if the low four bits of the first byte
602+
# are nonzero the header name is indexed.
603603
if should_index:
604604
indexed_name = to_byte(data[0]) & 0x3F
605605
name_len = 6
606606
else:
607-
indexed_name = to_byte(data[0])
607+
indexed_name = to_byte(data[0]) & 0x0F
608608
name_len = 4
609609

610610
if indexed_name:

0 commit comments

Comments
 (0)