The issue was introduced in
5b7676ec600d (0.7.5) when njs module was
adapted to changes in nginx/1.23 related to header structures.
When special headers (Content-Length, Content-Type, Content-Encoding)
were set, the value of the last outgoing header might be overwritten
with a new set value.
This closes #555 issue on Github.
return NJS_ERROR;
}
- h = NULL;
part = &headers->part;
header = part->elts;
if (h->key.len == v->length
&& ngx_strncasecmp(h->key.data, v->start, v->length) == 0)
{
- break;
+ goto done;
}
}
+ h = NULL;
+
+done:
+
if (h != NULL && s.length == 0) {
h->hash = 0;
h = NULL;