diff options
Diffstat (limited to 'nginx/ngx_http_js_module.c')
-rw-r--r-- | nginx/ngx_http_js_module.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/nginx/ngx_http_js_module.c b/nginx/ngx_http_js_module.c index e9132fd8..4e2f0077 100644 --- a/nginx/ngx_http_js_module.c +++ b/nginx/ngx_http_js_module.c @@ -1831,6 +1831,11 @@ ngx_http_js_ext_internal_redirect(njs_vm_t *vm, njs_value_t *args, 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) { |