]> git.kaiwu.me - njs.git/commit
HTTP: added support for multi-valued headers in r.headersOut.
authorDmitry Volyntsev <xeioex@nginx.com>
Tue, 21 Apr 2020 12:37:00 +0000 (12:37 +0000)
committerDmitry Volyntsev <xeioex@nginx.com>
Tue, 21 Apr 2020 12:37:00 +0000 (12:37 +0000)
commitf9a00172aa17c322f1d930786af00b84821c0c1e
treed17fa548950452b5155df7d42b8f07a6d28048b3
parentf13f466e139de2ae98b0335bd1bf36b8ba809cd0
HTTP: added support for multi-valued headers in r.headersOut.

1) Added support for an array of values in assignments:
    r.headersOut['Set-Cookie'] = ['a', '', 'b'] will result in

    Set-Cookie: a
    Set-Cookie: b

    headers in output. All previous Set-Cookie are deleted.

    Only the last element in the table will take effect for standard
    headers such as Content-Type that only accept a single value.

    r.headersOut.foo = [] is the same as

    delete r.headersOut.foo

2) Improved getting of special arrays:
    Set-Cookie is always returned as an array.
    Duplicates of Age, Content-Length, Content-Type, ETag, Expires,
    Last-Modified, Location, Retry-After are ignored.
    All other duplicate header values are joined together with ','.

This closes #266 issue on Github.
nginx/ngx_http_js_module.c