Skip to content

Commit 852b4c0

Browse files
benglrvagg
authored andcommitted
doc: clarify duplicate header handling
This commit documents how duplicate HTTP headers are handled. PR-URL: #3810 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Roman Reiss <[email protected]>
1 parent d94abad commit 852b4c0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

doc/api/http.markdown

+10
Original file line numberDiff line numberDiff line change
@@ -816,6 +816,16 @@ Example:
816816
// accept: '*/*' }
817817
console.log(request.headers);
818818

819+
Duplicates in raw headers are handled in the following ways, depending on the
820+
header name:
821+
822+
* Duplicates of `age`, `authorization`, `content-length`, `content-type`,
823+
`etag`, `expires`, `from`, `host`, `if-modified-since`, `if-unmodified-since`,
824+
`last-modified`, `location`, `max-forwards`, `proxy-authorization`, `referer`,
825+
`retry-after`, or `user-agent` are discarded.
826+
* `set-cookie` is always an array. Duplicates are added to the array.
827+
* For all other headers, the values are joined together with ', '.
828+
819829
### message.httpVersion
820830

821831
In case of server request, the HTTP version sent by the client. In the case of

0 commit comments

Comments
 (0)