diff options
author | Dmitry Volyntsev <xeioex@nginx.com> | 2024-09-17 19:17:09 -0700 |
---|---|---|
committer | Dmitry Volyntsev <xeioexception@gmail.com> | 2024-09-17 21:52:27 -0700 |
commit | c2bc8c6501b1712f75ea6a82a153383d3d3d2017 (patch) | |
tree | 38febd5498b95a735f1db412cb94c4050b5181bf /nginx/ngx_http_js_module.c | |
parent | 201b127679e27fe63eff5c1b4356ec4ed9ec4611 (diff) | |
download | njs-c2bc8c6501b1712f75ea6a82a153383d3d3d2017.tar.gz njs-c2bc8c6501b1712f75ea6a82a153383d3d3d2017.zip |
HTTP: fixed r.subrequest() check for nested subrequests.
The issue was introduced in a14be61c86 (0.8.5).
This fixes #783 on Github.
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 4a50a949..dec65198 100644 --- a/nginx/ngx_http_js_module.c +++ b/nginx/ngx_http_js_module.c @@ -3358,7 +3358,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 (r->main != r) { + if (r->subrequest_in_memory) { njs_vm_error(vm, "subrequest can only be created for " "the primary request"); return NJS_ERROR; @@ -5722,7 +5722,7 @@ ngx_http_qjs_ext_subrequest(JSContext *cx, JSValueConst this_val, ctx = ngx_http_get_module_ctx(r, ngx_http_js_module); - if (r->main != r) { + if (r->subrequest_in_memory) { return JS_ThrowTypeError(cx, "subrequest can only be created for " "the primary request"); } |