# HG changeset patch # User Sergey Kandaurov # Date 1588956318 -10800 # Node ID cd6abbe0f9899c64f992b5208de7b1bebf2e3eba # Parent 4cc012205ac533bd531538ec3cfc4f10b34f5345 Tests: added generic tests for $arg_ variables. diff --git a/http_variables.t b/http_variables.t --- 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');