Skip to content

Commit

Permalink
HTTP: fixed r.subrequest() check for nested subrequests.
Browse files Browse the repository at this point in the history
The issue was introduced in a14be61 (0.8.5).

This fixes #783 on Github.
  • Loading branch information
xeioex committed Sep 18, 2024
1 parent 201b127 commit b2de947
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nginx/ngx_http_js_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");
}
Expand Down

0 comments on commit b2de947

Please sign in to comment.