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

Commit 7422011

Browse files
author
Tim Emiola
committed
Fix a test that uses disallowed headers
1 parent 9e8c5d4 commit 7422011

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

test/test_integration.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,9 @@ def socket_handler(listener):
361361
sock.send(f.serialize())
362362

363363
# Now, send a headers frame again, containing trailing headers.
364-
f = build_headers_frame([(':res', 'no'), ('trailing', 'sure')], e)
364+
f = build_headers_frame([
365+
('trialing', 'no'),
366+
('trailing', 'sure')], e)
365367
f.flags.add('END_STREAM')
366368
f.stream_id = 1
367369
sock.send(f.serialize())
@@ -385,9 +387,10 @@ def socket_handler(listener):
385387
# Confirm that we got the trailing headers, and that they don't contain
386388
# reserved headers.
387389
assert resp.trailers['trailing'] == [b'sure']
390+
assert resp.trailers['trialing'] == [b'no']
388391
assert resp.trailers.get(':res') is None
389392
assert len(resp.headers) == 1
390-
assert len(resp.trailers) == 1
393+
assert len(resp.trailers) == 2
391394

392395
# Awesome, we're done now.
393396
recv_event.wait(5)
@@ -429,7 +432,9 @@ def socket_handler(listener):
429432
time.sleep(0.5)
430433

431434
# Now, send a headers frame again, containing trailing headers.
432-
f = build_headers_frame([(':res', 'no'), ('trailing', 'sure')], e)
435+
f = build_headers_frame([
436+
('trialing', 'no'),
437+
('trailing', 'sure')], e)
433438
f.flags.add('END_STREAM')
434439
f.stream_id = 1
435440
sock.send(f.serialize())
@@ -453,9 +458,9 @@ def socket_handler(listener):
453458
# reserved headers. More importantly, check the trailers *first*,
454459
# before we read from the stream.
455460
assert resp.trailers['trailing'] == [b'sure']
456-
assert resp.trailers.get(':res') is None
461+
assert resp.trailers['trialing'] == [b'no']
457462
assert len(resp.headers) == 1
458-
assert len(resp.trailers) == 1
463+
assert len(resp.trailers) == 2
459464

460465
# Confirm that the stream is still readable.
461466
assert resp.read() == b'have some data'

0 commit comments

Comments
 (0)