Welcome! Log In Create A New Profile

Advanced

[njs] HTTP: throwing an exception in internalRedirect() for a subrequest.

Alexander Borisov
October 08, 2020 11:50AM
details: https://hg.nginx.org/njs/rev/893fa730285c
branches:
changeset: 1538:893fa730285c
user: Alexander Borisov <alexander.borisov@nginx.com>
date: Thu Oct 08 18:47:04 2020 +0300
description:
HTTP: throwing an exception in internalRedirect() for a subrequest.

This closes #214 issue on GitHub.

diffstat:

nginx/ngx_http_js_module.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)

diffs (15 lines):

diff -r 036a4fbf9204 -r 893fa730285c nginx/ngx_http_js_module.c
--- a/nginx/ngx_http_js_module.c Tue Oct 06 20:51:56 2020 +0300
+++ b/nginx/ngx_http_js_module.c Thu Oct 08 18:47:04 2020 +0300
@@ -1831,6 +1831,11 @@ ngx_http_js_ext_internal_redirect(njs_vm
return NJS_ERROR;
}

+ if (r->parent != NULL) {
+ njs_vm_error(vm, "internalRedirect cannot be called from a subrequest");
+ return NJS_ERROR;
+ }
+
ctx = ngx_http_get_module_ctx(r, ngx_http_js_module);

if (ngx_http_js_string(vm, njs_arg(args, nargs, 1), &uri) != NJS_OK) {
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[njs] HTTP: throwing an exception in internalRedirect() for a subrequest.

Alexander Borisov 460 October 08, 2020 11:50AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 309
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready