Mercurial > hg > nginx-tests
changeset 116:c8341d95297e
Tests: add some HEAD gzip tests.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Tue, 01 Dec 2009 19:38:22 +0300 |
parents | cb1b04d8de29 |
children | f2b8d86438ee |
files | gzip.t |
diffstat | 1 files changed, 19 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/gzip.t Tue Dec 01 19:29:48 2009 +0300 +++ b/gzip.t Tue Dec 01 19:38:22 2009 +0300 @@ -21,7 +21,7 @@ select STDERR; $| = 1; select STDOUT; $| = 1; -my $t = Test::Nginx->new()->has('gzip')->plan(6); +my $t = Test::Nginx->new()->has('gzip')->plan(8); $t->write_file_expand('nginx.conf', <<'EOF'); @@ -77,4 +77,22 @@ unlike(http_gzip_request('/proxy/'), qr/Accept-Ranges/im, 'cleared headers from proxy'); +# HEAD requests should return correct headers + +like(http_gzip_head('/'), qr/Content-Encoding: gzip/, 'gzip head'); +unlike(http_head('/'), qr/Content-Encoding: gzip/, 'no gzip head'); + ############################################################################### + +sub http_gzip_head { + my ($uri) = @_; + return http(<<EOF); +HEAD $uri HTTP/1.1 +Host: localhost +Connection: close +Accept-Encoding: gzip + +EOF +} + +###############################################################################