From abd33656883cde9db4daa5a033d099d60c3380f4 Mon Sep 17 00:00:00 2001 From: Dmitry Volyntsev Date: Thu, 11 Jun 2026 16:46:43 -0700 Subject: [PATCH] QuickJS: fix promise and event leak on proxy URL evaluation failure Previously, when dynamic proxy URL evaluation failed in ngx_qjs_fetch(), the error was returned directly, bypassing the fail path which deletes the registered fetch event and releases the promise. The njs counterpart already goes through the fail path. As a side effect, the error is now reported by rejecting the returned promise instead of throwing synchronously, consistently with the other failure paths. --- nginx/ngx_qjs_fetch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx/ngx_qjs_fetch.c b/nginx/ngx_qjs_fetch.c index 1754f4eb..854deb52 100644 --- a/nginx/ngx_qjs_fetch.c +++ b/nginx/ngx_qjs_fetch.c @@ -346,7 +346,7 @@ ngx_qjs_ext_fetch(JSContext *cx, JSValueConst this_val, int argc, != NGX_OK) { JS_ThrowInternalError(cx, "failed to evaluate proxy URL"); - return JS_EXCEPTION; + goto fail; } } else { -- 2.47.3