Mercurial > hg > nginx-tests
comparison h2.t @ 821:d75000247e1f
Tests: added HTTP/2 test for padded HEADERS with CONTINUATION.
Reported by Shengtuo Hu, see
http://mailman.nginx.org/pipermail/nginx/2016-January/049693.html.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Tue, 26 Jan 2016 16:57:33 +0300 |
parents | 685fc620d721 |
children | 92e20c77c916 |
comparison
equal
deleted
inserted
replaced
820:45471a9017cc | 821:d75000247e1f |
---|---|
30 eval { IO::Socket::SSL::SSL_VERIFY_NONE(); }; | 30 eval { IO::Socket::SSL::SSL_VERIFY_NONE(); }; |
31 plan(skip_all => 'IO::Socket::SSL too old') if $@; | 31 plan(skip_all => 'IO::Socket::SSL too old') if $@; |
32 | 32 |
33 my $t = Test::Nginx->new()->has(qw/http http_ssl http_v2 proxy cache/) | 33 my $t = Test::Nginx->new()->has(qw/http http_ssl http_v2 proxy cache/) |
34 ->has(qw/limit_conn rewrite realip shmem/) | 34 ->has(qw/limit_conn rewrite realip shmem/) |
35 ->has_daemon('openssl')->plan(292); | 35 ->has_daemon('openssl')->plan(293); |
36 | 36 |
37 # Some systems may have also a bug in not treating zero writev iovcnt as EINVAL | 37 # Some systems may have also a bug in not treating zero writev iovcnt as EINVAL |
38 | 38 |
39 $t->todo_alerts(); | 39 $t->todo_alerts(); |
40 | 40 |
1082 { name => ':authority', value => 'localhost', mode => 1 }]}); | 1082 { name => ':authority', value => 'localhost', mode => 1 }]}); |
1083 $frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]); | 1083 $frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]); |
1084 | 1084 |
1085 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames; | 1085 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames; |
1086 is($frame->{headers}->{':status'}, 200, 'padding - next stream'); | 1086 is($frame->{headers}->{':status'}, 200, 'padding - next stream'); |
1087 | |
1088 # padding followed by CONTINUATION | |
1089 | |
1090 TODO: { | |
1091 local $TODO = 'not yet'; | |
1092 | |
1093 $sess = new_session(); | |
1094 $sid = new_stream($sess, { padding => 42, continuation => [ 2, 4, 1, 5 ], | |
1095 headers => [ | |
1096 { name => ':method', value => 'GET', mode => 1 }, | |
1097 { name => ':scheme', value => 'http', mode => 0 }, | |
1098 { name => ':path', value => '/', mode => 0 }, | |
1099 { name => ':authority', value => 'localhost', mode => 1 }]}); | |
1100 $frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]); | |
1101 | |
1102 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames; | |
1103 is($frame->{headers}->{':status'}, 200, 'padding - CONTINUATION'); | |
1104 | |
1105 } | |
1087 | 1106 |
1088 # request header field with multiple values | 1107 # request header field with multiple values |
1089 | 1108 |
1090 # 8.1.2.5. Compressing the Cookie Header Field | 1109 # 8.1.2.5. Compressing the Cookie Header Field |
1091 # To allow for better compression efficiency, the Cookie header field | 1110 # To allow for better compression efficiency, the Cookie header field |