]> git.kaiwu.me - njs.git/commitdiff
Tests: adapting unsafe redirect test for QuickJS.
authorDmitry Volyntsev <xeioex@nginx.com>
Fri, 26 Jul 2024 00:28:37 +0000 (17:28 -0700)
committerDmitry Volyntsev <xeioexception@gmail.com>
Fri, 26 Jul 2024 00:55:47 +0000 (17:55 -0700)
At the moment QuickJS has no API for getting strings
with NUL characters in the middle of the string.

Instead of a NUL byte make another unsafe redirect URI.

nginx/t/js_internal_redirect.t

index ec6be4e162090133a6dbf60230b4a55cc37ed245..abfe79f9a20972b5fed881d42b0ab6b480b3d25b 100644 (file)
@@ -72,7 +72,7 @@ $t->write_file('test.js', <<EOF);
             r.internalRedirect('\@named');
 
         } else if (r.variables.arg_unsafe) {
-            r.internalRedirect('/red\0rect');
+            r.internalRedirect('/red/../rect');
 
         } else if (r.variables.arg_quoted) {
             r.internalRedirect('/red%69rect');