The issue was introduced in
a14be61c86 (0.8.5).
This fixes #783 on Github.
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;
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");
}