From: Dmitry Volyntsev Date: Fri, 10 Mar 2023 22:15:29 +0000 (-0800) Subject: Fetch: fixed Headers() constructor. X-Git-Tag: 0.7.12~10 X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=07bea6882969dd75f23c78016bd4b0a0076c146d;p=njs.git Fetch: fixed Headers() constructor. Previously, the 'guard' field of ngx_js_headers_t structure was uninitialized, that caused spurious exception "Error: cannot append to immutable object". This issue was introduced on 0.7.10. --- diff --git a/nginx/ngx_js_fetch.c b/nginx/ngx_js_fetch.c index 9824baf8..f329d717 100644 --- a/nginx/ngx_js_fetch.c +++ b/nginx/ngx_js_fetch.c @@ -860,6 +860,8 @@ ngx_js_ext_headers_constructor(njs_vm_t *vm, njs_value_t *args, return NJS_ERROR; } + headers->guard = GUARD_NONE; + rc = ngx_list_init(&headers->header_list, pool, 4, sizeof(ngx_js_tb_elt_t)); if (rc != NGX_OK) { njs_vm_memory_error(vm);