-
Notifications
You must be signed in to change notification settings - Fork 69
/
Copy pathhttp2_spec_4_3_SUITE.erl
36 lines (29 loc) · 1.01 KB
/
http2_spec_4_3_SUITE.erl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
-module(http2_spec_4_3_SUITE).
-include("http2.hrl").
-include_lib("eunit/include/eunit.hrl").
-include_lib("common_test/include/ct.hrl").
-compile([export_all]).
all() ->
[
sends_invalid_header_block_fragment
].
init_per_suite(Config) ->
application:ensure_started(crypto),
chatterbox_test_buddy:start(Config).
end_per_suite(Config) ->
chatterbox_test_buddy:stop(Config),
ok.
sends_invalid_header_block_fragment(_Config) ->
{ok, Client} = http2c:start_link(),
%% Bad Header Block, Literal Header Field with Incremental
%% Indexing without Length and String segment
Bin = <<16#00,16#00,16#01,16#01,16#05,
16#00,16#00,16#00,16#01,16#40>>,
http2c:send_binary(Client, Bin),
Resp = http2c:wait_for_n_frames(Client, 0, 1),
ct:pal("Resp: ~p", [Resp]),
?assertEqual(1, (length(Resp))),
[{GoAwayH, GoAway}] = Resp,
?assertEqual(?GOAWAY, (GoAwayH#frame_header.type)),
?assertEqual(?COMPRESSION_ERROR, (h2_frame_goaway:error_code(GoAway))),
ok.