[njs] Tests: adapting unsafe redirect test for QuickJS.

noreply at nginx.com noreply at nginx.com
Fri Jul 26 00:56:02 UTC 2024


details:   https://github.com/nginx/njs/commit/3ac496802862347c5cf8f0b6e3825163dc7bb1c9
branches:  master
commit:    3ac496802862347c5cf8f0b6e3825163dc7bb1c9
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Thu, 25 Jul 2024 17:28:37 -0700
description:
Tests: adapting unsafe redirect test for QuickJS.

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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nginx/t/js_internal_redirect.t b/nginx/t/js_internal_redirect.t
index ec6be4e1..abfe79f9 100644
--- a/nginx/t/js_internal_redirect.t
+++ b/nginx/t/js_internal_redirect.t
@@ -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');


More information about the nginx-devel mailing list