Mercurial > hg > nginx-site
changeset 2894:438a9cfa4fae
Added info about setting r.headersOut in njs reference.
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Fri, 30 Sep 2022 16:42:42 +0100 |
parents | 8f3955097546 |
children | 9708787aafc7 |
files | xml/en/docs/njs/reference.xml |
diffstat | 1 files changed, 21 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/xml/en/docs/njs/reference.xml Tue Sep 27 16:13:35 2022 +0400 +++ b/xml/en/docs/njs/reference.xml Fri Sep 30 16:42:42 2022 +0100 @@ -9,7 +9,7 @@ <article name="Reference" link="/en/docs/njs/reference.html" lang="en" - rev="89"> + rev="90"> <section id="summary"> @@ -173,6 +173,26 @@ </para> <para> +Outgoing headers should be set before a response header is sent to a client, +otherwise header update will be ignored. +This means that <literal>r.headersOut{}</literal> is effectively writable in: + +<list type="bullet"> + +<listitem> +the <link doc="../http/ngx_http_js_module.xml" id="js_content"/> handler before +<link id="r_send_header"><literal>r.sendHeader()</literal></link> or +<link id="r_return"><literal>r.return()</literal></link> are called +</listitem> + +<listitem> +the <link doc="../http/ngx_http_js_module.xml" id="js_header_filter"/> handler +</listitem> + +</list> +</para> + +<para> Field values of multi-value response headers (<link doc="changes.xml" id="njs0.4.0">0.4.0</link>) can be set with the syntax: