Tests: xslt_stylesheet parameter from variable.
diff --git a/xslt.t b/xslt.t
index c50c3f2..1516e97 100644
--- a/xslt.t
+++ b/xslt.t
@@ -21,7 +21,7 @@
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 @@
xslt_stylesheet %%TESTDIR%%/first.xslt;
xslt_stylesheet %%TESTDIR%%/test.xslt;
}
+ location /x5 {
+ xslt_stylesheet %%TESTDIR%%/test.xslt
+ param1='$server_name';
+ }
}
}
@@ -102,6 +106,7 @@
$t->write_file('x2', '<root>data</root>');
$t->write_file('x3', '<!DOCTYPE root><root>&test;</root>');
$t->write_file('x4', '<root>data</root>');
+$t->write_file('x5', '<root>data</root>');
$t->run();
@@ -114,4 +119,12 @@
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');
+
+}
+
###############################################################################