From 4228141012fff26dbe10d708e7beb5d12cf38c42 Mon Sep 17 00:00:00 2001 From: Gerhard Stoebich Date: Wed, 13 Jun 2018 00:26:42 +0200 Subject: [PATCH] doc: Improve doc for Http2 headers object Add more details regarding processing and data type of incoming headers in Http2. Backport-PR-URL: https://github.com/nodejs/node/pull/22850 PR-URL: https://github.com/nodejs/node/pull/21296 Reviewed-By: Anna Henningsen Reviewed-By: James M Snell Reviewed-By: Ujjwal Sharma --- doc/api/http2.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/doc/api/http2.md b/doc/api/http2.md index 3ffb41e1402ca2..c5c4cb4c95d352 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -2120,6 +2120,23 @@ prototype. This means that normal JavaScript object methods such as `Object.prototype.toString()` and `Object.prototype.hasOwnProperty()` will not work. +For incoming headers: +* The `:status` header is converted to `number`. +* Duplicates of `:status`, `:method`, `:authority`, `:scheme`, `:path`, +`age`, `authorization`, `access-control-allow-credentials`, +`access-control-max-age`, `access-control-request-method`, `content-encoding`, +`content-language`, `content-length`, `content-location`, `content-md5`, +`content-range`, `content-type`, `date`, `dnt`, `etag`, `expires`, `from`, +`if-match`, `if-modified-since`, `if-none-match`, `if-range`, +`if-unmodified-since`, `last-modified`, `location`, `max-forwards`, +`proxy-authorization`, `range`, `referer`,`retry-after`, `tk`, +`upgrade-insecure-requests`, `user-agent` or `x-content-type-options` are +discarded. +* `set-cookie` is a string if present once or an array in case duplicates +are present. +* `cookie`: the values are joined together with '; '. +* For all other headers, the values are joined together with ', '. + ```js const http2 = require('http2'); const server = http2.createServer();