Mercurial > hg > nginx-site
comparison xml/en/docs/njs/reference.xml @ 2543:f39c4724c0f8
Described multi-value headers in r.headersIn.
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Tue, 19 May 2020 15:05:49 +0100 |
parents | d6bbfd20c82f |
children | 33347df1da9c |
comparison
equal
deleted
inserted
replaced
2542:bde7cd9a1173 | 2543:f39c4724c0f8 |
---|---|
7 <!DOCTYPE article SYSTEM "../../../../dtd/article.dtd"> | 7 <!DOCTYPE article SYSTEM "../../../../dtd/article.dtd"> |
8 | 8 |
9 <article name="Reference" | 9 <article name="Reference" |
10 link="/en/docs/njs/reference.html" | 10 link="/en/docs/njs/reference.html" |
11 lang="en" | 11 lang="en" |
12 rev="40"> | 12 rev="41"> |
13 | 13 |
14 <section id="summary"> | 14 <section id="summary"> |
15 | 15 |
16 <para> | 16 <para> |
17 <link doc="index.xml">njs</link> provides objects, methods and properties | 17 <link doc="index.xml">njs</link> provides objects, methods and properties |
51 | 51 |
52 <tag-name id="r_headers_in"><literal>r.headersIn{}</literal></tag-name> | 52 <tag-name id="r_headers_in"><literal>r.headersIn{}</literal></tag-name> |
53 <tag-desc> | 53 <tag-desc> |
54 incoming headers object, read-only. | 54 incoming headers object, read-only. |
55 <para> | 55 <para> |
56 For example, the <literal>Foo</literal> header | 56 The <literal>Foo</literal> request header |
57 can be accessed with the syntax <literal>headersIn.foo</literal> | 57 can be accessed with the syntax: |
58 or <literal>headersIn['Foo']</literal> | 58 <literal>headersIn.foo</literal> or <literal>headersIn['Foo']</literal>. |
59 <note> | 59 </para> |
60 Before version <link doc="changes.xml" id="njs0.3.6">0.3.6</link>, | 60 |
61 for headers that could appear multiple times such as | 61 <para> |
62 <header>Cookie</header> or <header>X-Forwarded-For</header>, | 62 The |
63 only the first value was returned. | 63 <header>Authorization</header>, |
64 To get all cookies, | 64 <header>Content-Length</header>, |
65 <literal>r.variables.http_cookie</literal> | 65 <header>Content-Range</header>, |
66 should be used. | 66 <header>Content-Type</header>, |
67 To get the <literal>name</literal> cookie, | 67 <header>ETag</header>, |
68 <literal>r.variables["cookie_<value>name</value>"]</literal> | 68 <header>Expect</header>, |
69 should be used. | 69 <header>From</header>, |
70 </note> | 70 <header>Host</header>, |
71 <header>If-Match</header>, | |
72 <header>If-Modified-Since</header>, | |
73 <header>If-None-Match</header>, | |
74 <header>If-Range</header>, | |
75 <header>If-Unmodified-Since</header>, | |
76 <header>Max-Forwards</header>, | |
77 <header>Proxy-Authorization</header>, | |
78 <header>Referer</header>, | |
79 <header>Transfer-Encoding</header>, and | |
80 <header>User-Agent</header> | |
81 request headers can have only one field value | |
82 (<link doc="changes.xml" id="njs0.4.1">0.4.1</link>). | |
83 Duplicate field values in <header>Cookie</header> headers | |
84 are separated by semicolon (<literal>;</literal>). | |
85 Duplicate field values in all other request headers are separated by commas. | |
71 </para> | 86 </para> |
72 </tag-desc> | 87 </tag-desc> |
73 | 88 |
74 <tag-name id="r_headers_out"><literal>r.headersOut{}</literal></tag-name> | 89 <tag-name id="r_headers_out"><literal>r.headersOut{}</literal></tag-name> |
75 <tag-desc> | 90 <tag-desc> |