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

Commit 71e750d

Browse files
committed
Failing test for #110.
1 parent c5775cb commit 71e750d

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

test/test_hyper.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -931,6 +931,45 @@ def test_resizing_header_table(self):
931931
d.header_table_size = 40
932932
assert len(d.header_table) == 0
933933

934+
def test_apache_trafficserver(self):
935+
# This test reproduces the bug in #110, using exactly the same header
936+
# data.
937+
d = Decoder()
938+
data = (
939+
b'\x10\x07:status\x03200@\x06server\tATS/6.0.0'
940+
b'@\x04date\x1dTue, 31 Mar 2015 08:09:51 GMT'
941+
b'@\x0ccontent-type\ttext/html@\x0econtent-length\x0542468'
942+
b'@\rlast-modified\x1dTue, 31 Mar 2015 01:55:51 GMT'
943+
b'@\x04vary\x0fAccept-Encoding@\x04etag\x0f"5519fea7-a5e4"'
944+
b'@\x08x-served\x05Nginx@\x14x-subdomain-tryfiles\x04True'
945+
b'@\x07x-deity\thydra-lts@\raccept-ranges\x05bytes@\x03age\x010'
946+
b'@\x19strict-transport-security\rmax-age=86400'
947+
b'@\x03via2https/1.1 ATS (ApacheTrafficServer/6.0.0 [cSsNfU])'
948+
)
949+
expect = [
950+
(':status', '200'),
951+
('server', 'ATS/6.0.0'),
952+
('date', 'Tue, 31 Mar 2015 08:09:51 GMT'),
953+
('content-type', 'text/html'),
954+
('content-length', '42468'),
955+
('last-modified', 'Tue, 31 Mar 2015 01:55:51 GMT'),
956+
('vary', 'Accept-Encoding'),
957+
('etag', '"5519fea7-a5e4"'),
958+
('x-served', 'Nginx'),
959+
('x-subdomain-tryfiles', 'True'),
960+
('x-deity', 'hydra-lts'),
961+
('accept-ranges', 'bytes'),
962+
('age', '0'),
963+
('strict-transport-security', 'max-age=86400'),
964+
('via', 'https/1.1 ATS (ApacheTrafficServer/6.0.0 [cSsNfU])'),
965+
]
966+
967+
result = d.decode(data)
968+
969+
assert result == expect
970+
# The status header shouldn't be indexed.
971+
assert len(d.header_table) == len(expect) - 1
972+
934973

935974
class TestIntegerEncoding(object):
936975
# These tests are stolen from the HPACK spec.

0 commit comments

Comments
 (0)