@@ -640,16 +640,16 @@ def test_request_examples_without_huffman(self):
640640 (n .encode ('utf-8' ), v .encode ('utf-8' )) for n , v in first_header_table
641641 ]
642642
643- # This request takes advantage of the differential encoding of header
644- # sets.
645643 second_header_set = [
646644 (':method' , 'GET' ,),
647645 (':scheme' , 'http' ,),
648646 (':path' , '/' ,),
649647 (':authority' , 'www.example.com' ,),
650648 ('cache-control' , 'no-cache' ),
651649 ]
652- second_result = b'\x04 \x0f www.example.com\x0f \x0c \x08 no-cache'
650+ second_result = (
651+ b'\x83 \x82 \x81 \x04 \x0f www.example.com\x0f \x0c \x08 no-cache'
652+ )
653653
654654 assert e .encode (second_header_set , huffman = False ) == second_result
655655 assert list (e .header_table ) == [
@@ -664,8 +664,7 @@ def test_request_examples_without_huffman(self):
664664 ('custom-key' , 'custom-value' ),
665665 ]
666666 third_result = (
667- b'\x8a \x89 \x06 \x0f www.example.com@\n custom-key\x0c custom-value' +
668- b'\x84 \x85 '
667+ b'\x83 \x8a \x89 \x06 \x0f www.example.com@\n custom-key\x0c custom-value'
669668 )
670669
671670 assert e .encode (third_header_set , huffman = False ) == third_result
@@ -696,8 +695,6 @@ def test_request_examples_with_huffman(self):
696695 (n .encode ('utf-8' ), v .encode ('utf-8' )) for n , v in first_header_table
697696 ]
698697
699- # This request takes advantage of the differential encoding of header
700- # sets.
701698 second_header_set = [
702699 (':method' , 'GET' ,),
703700 (':scheme' , 'http' ,),
@@ -706,8 +703,8 @@ def test_request_examples_with_huffman(self):
706703 ('cache-control' , 'no-cache' ),
707704 ]
708705 second_result = (
709- b'\x04 \x8c \xf1 \xe3 \xc2 \xe5 \xf2 :k\xa0 \xab \x90 \xf4 \xff \x0f \x0c \x86 '
710- b'\xa8 \xeb \x10 d\x9c \xbf '
706+ b'\x83 \x82 \x81 \ x04\x8c \xf1 \xe3 \xc2 \xe5 \xf2 :k\xa0 \xab \x90 \xf4 \xff '
707+ b'\x0f \x0c \x86 \ xa8\xeb \x10 d\x9c \xbf '
711708 )
712709
713710 assert e .encode (second_header_set , huffman = True ) == second_result
@@ -726,8 +723,8 @@ def test_request_examples_with_huffman(self):
726723 ('custom-key' , 'custom-value' ),
727724 ]
728725 third_result = (
729- b'\x8a \x89 \x06 \x8c \xf1 \xe3 \xc2 \xe5 \xf2 :k\xa0 \xab \x90 \xf4 \xff @\x88 % '
730- b'\xa8 I\xe9 [\xa9 }\x7f \x89 %\xa8 I\xe9 [\xb8 \xe8 \xb4 \xbf \x84 \x85 '
726+ b'\x83 \ x8a\x89 \x06 \x8c \xf1 \xe3 \xc2 \xe5 \xf2 :k\xa0 \xab \x90 \xf4 \xff @'
727+ b'\x88 % \ xa8 I\xe9 [\xa9 }\x7f \x89 %\xa8 I\xe9 [\xb8 \xe8 \xb4 \xbf '
731728 )
732729
733730 assert e .encode (third_header_set , huffman = True ) == third_result
@@ -869,7 +866,9 @@ def test_request_examples_without_huffman(self):
869866 (':authority' , 'www.example.com' ,),
870867 ('cache-control' , 'no-cache' ),
871868 ]
872- second_data = b'\x04 \x0f www.example.com\x0f \x0c \x08 no-cache'
869+ second_data = (
870+ b'\x83 \x82 \x81 \x04 \x0f www.example.com\x0f \x0c \x08 no-cache'
871+ )
873872
874873 assert sorted (d .decode (second_data )) == sorted (second_header_set )
875874 assert list (d .header_table ) == [
@@ -887,8 +886,7 @@ def test_request_examples_without_huffman(self):
887886 ('custom-key' , 'custom-value' ),
888887 ]
889888 third_data = (
890- b'\x30 \x83 \x8a \x89 \x06 \x0f www.example.com' +
891- b'\x40 \x0a custom-key\x0c custom-value'
889+ b'\x83 \x8a \x89 \x06 \x0f www.example.com@\n custom-key\x0c custom-value'
892890 )
893891
894892 assert sorted (d .decode (third_data )) == sorted (third_header_set )
@@ -920,8 +918,6 @@ def test_request_examples_with_huffman(self):
920918 if n != ':authority'
921919 ]
922920
923- # This request takes advantage of the differential encoding of header
924- # sets.
925921 second_header_set = [
926922 (':method' , 'GET' ,),
927923 (':scheme' , 'http' ,),
@@ -931,8 +927,8 @@ def test_request_examples_with_huffman(self):
931927 ]
932928 second_header_table = second_header_set [::- 1 ]
933929 second_data = (
934- b'\x04 \x8c \xf1 \xe3 \xc2 \xe5 \xf2 :k\xa0 \xab \x90 \xf4 \xff \x0f \x0c \x86 '
935- b'\xa8 \xeb \x10 d\x9c \xbf '
930+ b'\x83 \x82 \x81 \ x04\x8c \xf1 \xe3 \xc2 \xe5 \xf2 :k\xa0 \xab \x90 \xf4 \xff '
931+ b'\x0f \x0c \x86 \ xa8\xeb \x10 d\x9c \xbf '
936932 )
937933
938934 assert sorted (d .decode (second_data )) == sorted (second_header_set )
@@ -952,8 +948,8 @@ def test_request_examples_with_huffman(self):
952948 ('custom-key' , 'custom-value' ),
953949 ]
954950 third_data = (
955- b'\x8a \x89 \x06 \x8c \xf1 \xe3 \xc2 \xe5 \xf2 :k\xa0 \xab \x90 \xf4 \xff @\x88 % '
956- b'\xa8 I\xe9 [\xa9 }\x7f \x89 %\xa8 I\xe9 [\xb8 \xe8 \xb4 \xbf \x84 \x85 '
951+ b'\x83 \ x8a\x89 \x06 \x8c \xf1 \xe3 \xc2 \xe5 \xf2 :k\xa0 \xab \x90 \xf4 \xff @'
952+ b'\x88 % \ xa8 I\xe9 [\xa9 }\x7f \x89 %\xa8 I\xe9 [\xb8 \xe8 \xb4 \xbf '
957953 )
958954
959955 assert sorted (d .decode (third_data )) == sorted (third_header_set )
0 commit comments