Tests: added extended js internalRedirect tests.
diff --git a/js_internal_redirect.t b/js_internal_redirect.t
index b700794..cae34ef 100644
--- a/js_internal_redirect.t
+++ b/js_internal_redirect.t
@@ -63,6 +63,12 @@
if (r.variables.arg_dest == 'named') {
r.internalRedirect('\@named');
+ } else if (r.variables.arg_unsafe) {
+ r.internalRedirect('/red\0rect');
+
+ } else if (r.variables.arg_quoted) {
+ r.internalRedirect('/red%69rect');
+
} else {
if (r.variables.arg_a) {
r.internalRedirect('/redirect?b=' + r.variables.arg_a);
@@ -77,7 +83,7 @@
EOF
-$t->try_run('no njs available')->plan(3);
+$t->try_run('no njs available')->plan(5);
###############################################################################
@@ -85,4 +91,14 @@
like(http_get('/test?a=A'), qr/redirectA/s, 'redirect with args');
like(http_get('/test?dest=named'), qr/named/s, 'redirect to named location');
+TODO: {
+local $TODO = 'not yet'
+ unless http_get('/njs') =~ /^([.0-9]+)$/m && $1 ge '0.7.4';
+
+like(http_get('/test?unsafe=1'), qr/500 Internal Server/s,
+ 'unsafe redirect');
+like(http_get('/test?quoted=1'), qr/200 .*redirect/s,
+ 'quoted redirect');
+}
+
###############################################################################