Mercurial > hg > nginx-tests
changeset 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 | 4cc012205ac5 |
children | 0077b80ef745 |
files | http_variables.t |
diffstat | 1 files changed, 13 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/http_variables.t Wed May 06 12:52:17 2020 +0000 +++ b/http_variables.t Fri May 08 19:45:18 2020 +0300 @@ -22,7 +22,7 @@ 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 @@ 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('/../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');