Mercurial > hg > nginx-tests
diff http_variables.t @ 1569:cd6abbe0f989
Tests: added generic tests for $arg_ variables.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Fri, 08 May 2020 19:45:18 +0300 |
parents | 4bc1490cedbc |
children | 5ac6efbe5552 |
line wrap: on
line diff
--- a/http_variables.t +++ b/http_variables.t @@ -22,7 +22,7 @@ use Test::Nginx; select STDERR; $| = 1; select STDOUT; $| = 1; -my $t = Test::Nginx->new()->has(qw/http rewrite proxy/)->plan(6); +my $t = Test::Nginx->new()->has(qw/http rewrite proxy/)->plan(7); $t->write_file_expand('nginx.conf', <<'EOF'); @@ -48,6 +48,10 @@ http { return 200 OK; } + location /arg { + return 200 $arg_l:$arg_; + } + location /set { add_header Cache-Control max-age=3600; add_header Cache-Control private; @@ -78,6 +82,14 @@ http_get('/'); http_get('/../bad_uri'); http_get('/redefine'); +TODO: { +todo_skip 'overflow', 1 unless $ENV{TEST_NGINX_UNSAFE} + or $t->has_version('1.19.0'); + +like(http_get('/arg?l=42'), qr/42:$/, 'arg'); + +} + # $limit_rate is a special variable that has its own set_handler / get_handler like(http_get('/limit_rate?l=40k'), qr/X-Rate: 40960/, 'limit_rate handlers');