ctx = ngx_http_get_module_ctx(r, ngx_http_js_module);
+ ctx->filter = 1;
pending = njs_vm_pending(ctx->vm);
rc = ngx_js_call(ctx->vm, &jlcf->header_filter, r->connection->log,
ctx = ngx_http_get_module_ctx(r, ngx_http_js_module);
+ if (ctx->filter) {
+ njs_vm_error(vm, "internalRedirect cannot be called while filtering");
+ return NJS_ERROR;
+ }
+
if (ngx_js_string(vm, njs_arg(args, nargs, 1), &uri) != NGX_OK) {
njs_vm_error(vm, "failed to convert uri arg");
return NJS_ERROR;