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

Commit b1fd9f4

Browse files
committed
Postel's Law is a bad idea.
If we decode a number that's larger than EOS we shouldn't treat it as the same as EOS. Something got screwed up, and we should say so.
1 parent 7436593 commit b1fd9f4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hyper/http20/huffman.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def decode(self, encoded_string):
6767
cur_node = cur_node.mapping[digit]
6868
if cur_node.data is not None:
6969
# If we get EOS, everything else is padding.
70-
if cur_node.data > 255:
70+
if cur_node.data == 256:
7171
break
7272

7373
decoded_message.append(cur_node.data)

0 commit comments

Comments
 (0)