# HG changeset patch # User Sergey Kandaurov # Date 1563466315 -10800 # Node ID 829467f8d696ac1e3452c4dc34280c3ec739bebc # Parent 760fdf2865bbf6e784fe8316302ec16a5575fd22 Tests: xslt_stylesheet parameter from variable. diff --git a/xslt.t b/xslt.t --- a/xslt.t +++ b/xslt.t @@ -21,7 +21,7 @@ use Test::Nginx; select STDERR; $| = 1; select STDOUT; $| = 1; -my $t = Test::Nginx->new()->has(qw/http xslt/)->plan(5); +my $t = Test::Nginx->new()->has(qw/http xslt/)->plan(6); $t->write_file_expand('nginx.conf', <<'EOF'); @@ -56,6 +56,10 @@ http { xslt_stylesheet %%TESTDIR%%/first.xslt; xslt_stylesheet %%TESTDIR%%/test.xslt; } + location /x5 { + xslt_stylesheet %%TESTDIR%%/test.xslt + param1='$server_name'; + } } } @@ -102,6 +106,7 @@ EOF $t->write_file('x2', 'data'); $t->write_file('x3', '&test;'); $t->write_file('x4', 'data'); +$t->write_file('x5', 'data'); $t->run(); @@ -114,4 +119,12 @@ like(http_get("/x2"), qr!200 OK.*param1= like(http_get("/x3"), qr!200 OK.*data=test entity!ms, 'entities'); like(http_get("/x4"), qr!200 OK.*data=other data!ms, 'several stylesheets'); +TODO: { +todo_skip 'heap-buffer-overflow', 1 unless $t->has_version('1.17.2') + or $ENV{TEST_NGINX_UNSAFE}; + +like(http_get("/x5"), qr!200 OK.*param1=localhost!ms, 'params variable'); + +} + ###############################################################################