# HG changeset patch # User Yaroslav Zhuravlev # Date 1589897149 -3600 # Node ID f39c4724c0f8f4156d6321f6cace916bbb3dfd25 # Parent bde7cd9a11737f3f64710e18dc24d3bcc5ebb2d8 Described multi-value headers in r.headersIn. diff --git a/xml/en/docs/njs/reference.xml b/xml/en/docs/njs/reference.xml --- a/xml/en/docs/njs/reference.xml +++ b/xml/en/docs/njs/reference.xml @@ -9,7 +9,7 @@
+ rev="41">
@@ -53,21 +53,36 @@ finishes sending a response to the clien incoming headers object, read-only. -For example, the Foo header -can be accessed with the syntax headersIn.foo -or headersIn['Foo'] - -Before version 0.3.6, -for headers that could appear multiple times such as -
Cookie
or
X-Forwarded-For
, -only the first value was returned. -To get all cookies, -r.variables.http_cookie -should be used. -To get the name cookie, -r.variables["cookie_name"] -should be used. -
+The Foo request header +can be accessed with the syntax: +headersIn.foo or headersIn['Foo']. +
+ + +The +
Authorization
, +
Content-Length
, +
Content-Range
, +
Content-Type
, +
ETag
, +
Expect
, +
From
, +
Host
, +
If-Match
, +
If-Modified-Since
, +
If-None-Match
, +
If-Range
, +
If-Unmodified-Since
, +
Max-Forwards
, +
Proxy-Authorization
, +
Referer
, +
Transfer-Encoding
, and +
User-Agent
+request headers can have only one field value +(0.4.1). +Duplicate field values in
Cookie
headers +are separated by semicolon (;). +Duplicate field values in all other request headers are separated by commas.
diff --git a/xml/ru/docs/njs/reference.xml b/xml/ru/docs/njs/reference.xml --- a/xml/ru/docs/njs/reference.xml +++ b/xml/ru/docs/njs/reference.xml @@ -54,21 +54,37 @@ объект входящих заголовков, только чтение. -Например, доступ к заголовку Foo -можно получить при помощи синтаксиса headersIn.foo -или headersIn['Foo'] - -До версии 0.3.6 -если заголовок был указан несколько раз, например -
Cookie
или
X-Forwarded-For
, -то возвращалось только первое значение. -Чтобы получить все cookie -необходимо использовать -r.variables.http_cookie. -Чтобы получить имя cookie -необходимо использовать -r.variables["cookie_имя"]. -
+Доступ к заголовку запроса Foo +можно получить при помощи синтаксиса: +headersIn.foo или headersIn['Foo']. +
+ + +Заголовки запроса +
Authorization
, +
Content-Length
, +
Content-Range
, +
Content-Type
, +
ETag
, +
Expect
, +
From
, +
Host
, +
If-Match
, +
If-Modified-Since
, +
If-None-Match
, +
If-Range
, +
If-Unmodified-Since
, +
Max-Forwards
, +
Proxy-Authorization
, +
Referer
, +
Transfer-Encoding
и +
User-Agent
+могут иметь только одно значение поля +(0.4.1). +Дубликаты значений поля в заголовке запроса
Cookie
+разделяются точкой с запятой (;). +Дубликаты значений поля во всех остальных заголовках запроса +разделяются запятой.