Mercurial > hg > nginx-tests
comparison h2.t @ 847:7de036e89770
Tests: added HTTP/2 test with gzip vary.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Fri, 05 Feb 2016 18:27:21 +0300 |
parents | 9b5e1c5f0240 |
children | 40ad07634a5e |
comparison
equal
deleted
inserted
replaced
846:9b5e1c5f0240 | 847:7de036e89770 |
---|---|
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(307); | 35 ->has_daemon('openssl')->plan(308); |
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 |
79 limit_conn conn 1; | 79 limit_conn conn 1; |
80 } | 80 } |
81 location /gzip.html { | 81 location /gzip.html { |
82 gzip on; | 82 gzip on; |
83 gzip_min_length 0; | 83 gzip_min_length 0; |
84 gzip_vary on; | |
84 alias %%TESTDIR%%/t2.html; | 85 alias %%TESTDIR%%/t2.html; |
85 } | 86 } |
86 location /frame_size { | 87 location /frame_size { |
87 add_header X-LongHeader $arg_h; | 88 add_header X-LongHeader $arg_h; |
88 add_header X-LongHeader $arg_h; | 89 add_header X-LongHeader $arg_h; |
1349 { name => 'accept-encoding', value => 'gzip' }]}); | 1350 { name => 'accept-encoding', value => 'gzip' }]}); |
1350 $frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]); | 1351 $frames = h2_read($sess, all => [{ sid => $sid, fin => 1 }]); |
1351 | 1352 |
1352 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames; | 1353 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames; |
1353 is($frame->{headers}->{'content-encoding'}, 'gzip', 'gzip - encoding'); | 1354 is($frame->{headers}->{'content-encoding'}, 'gzip', 'gzip - encoding'); |
1355 is($frame->{headers}->{'vary'}, 'Accept-Encoding', 'gzip - vary'); | |
1354 | 1356 |
1355 ($frame) = grep { $_->{type} eq "DATA" } @$frames; | 1357 ($frame) = grep { $_->{type} eq "DATA" } @$frames; |
1356 gunzip_like($frame->{data}, qr/^SEE-THIS\Z/, 'gzip - DATA'); | 1358 gunzip_like($frame->{data}, qr/^SEE-THIS\Z/, 'gzip - DATA'); |
1357 | 1359 |
1358 # charset | 1360 # charset |