diff options
author | Dmitry Volyntsev <xeioex@nginx.com> | 2024-06-12 23:31:08 -0700 |
---|---|---|
committer | Dmitry Volyntsev <xeioexception@gmail.com> | 2024-06-28 19:51:57 -0700 |
commit | a14be61c86db926c93645e929a79a960674b7715 (patch) | |
tree | 0cd327aed01bb658e987f198283ea1f7c9abb805 /nginx/ngx_http_js_module.c | |
parent | 59bba976de22ac2f69d0aec347e30c0e441e22c3 (diff) | |
download | njs-a14be61c86db926c93645e929a79a960674b7715.tar.gz njs-a14be61c86db926c93645e929a79a960674b7715.zip |
HTTP: simplified check for subrequest from a subrequest.
Diffstat (limited to 'nginx/ngx_http_js_module.c')
-rw-r--r-- | nginx/ngx_http_js_module.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/nginx/ngx_http_js_module.c b/nginx/ngx_http_js_module.c index 5c8c0480..260cd497 100644 --- a/nginx/ngx_http_js_module.c +++ b/nginx/ngx_http_js_module.c @@ -3153,7 +3153,7 @@ ngx_http_js_ext_subrequest(njs_vm_t *vm, njs_value_t *args, njs_uint_t nargs, ctx = ngx_http_get_module_ctx(r, ngx_http_js_module); - if (ctx->vm != vm) { + if (r->main != r) { njs_vm_error(vm, "subrequest can only be created for " "the primary request"); return NJS_ERROR; @@ -3511,7 +3511,7 @@ ngx_http_js_ext_get_parent(njs_vm_t *vm, njs_object_prop_t *prop, ctx = r->parent ? ngx_http_get_module_ctx(r->parent, ngx_http_js_module) : NULL; - if (ctx == NULL || ctx->vm != vm) { + if (ctx == NULL) { njs_value_undefined_set(retval); return NJS_DECLINED; } |