From 0c5429ac94d0625c325d8cd5a30179a8cd40a3ee Mon Sep 17 00:00:00 2001 From: Bryan English Date: Thu, 12 Nov 2015 23:21:22 -0800 Subject: [PATCH] doc: clarify duplicate header handling This commit documents how duplicate HTTP headers are handled. PR-URL: https://github.com/nodejs/node/pull/3810 Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Roman Reiss --- doc/api/http.markdown | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/api/http.markdown b/doc/api/http.markdown index 2e4775398c68dc..0714ebd461f101 100644 --- a/doc/api/http.markdown +++ b/doc/api/http.markdown @@ -816,6 +816,16 @@ Example: // accept: '*/*' } console.log(request.headers); +Duplicates in raw headers are handled in the following ways, depending on the +header name: + +* Duplicates of `age`, `authorization`, `content-length`, `content-type`, +`etag`, `expires`, `from`, `host`, `if-modified-since`, `if-unmodified-since`, +`last-modified`, `location`, `max-forwards`, `proxy-authorization`, `referer`, +`retry-after`, or `user-agent` are discarded. +* `set-cookie` is always an array. Duplicates are added to the array. +* For all other headers, the values are joined together with ', '. + ### message.httpVersion In case of server request, the HTTP version sent by the client. In the case of