Skip to content

Commit 4647f61

Browse files
Flarnatargos
authored andcommitted
doc: Improve doc for Http2 headers object
Add more details regarding processing and data type of incoming headers in Http2. PR-URL: #21296 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ujjwal Sharma <[email protected]>
1 parent fe6d707 commit 4647f61

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

doc/api/http2.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2118,6 +2118,23 @@ means that normal JavaScript object methods such as
21182118
`Object.prototype.toString()` and `Object.prototype.hasOwnProperty()` will
21192119
not work.
21202120

2121+
For incoming headers:
2122+
* The `:status` header is converted to `number`.
2123+
* Duplicates of `:status`, `:method`, `:authority`, `:scheme`, `:path`,
2124+
`age`, `authorization`, `access-control-allow-credentials`,
2125+
`access-control-max-age`, `access-control-request-method`, `content-encoding`,
2126+
`content-language`, `content-length`, `content-location`, `content-md5`,
2127+
`content-range`, `content-type`, `date`, `dnt`, `etag`, `expires`, `from`,
2128+
`if-match`, `if-modified-since`, `if-none-match`, `if-range`,
2129+
`if-unmodified-since`, `last-modified`, `location`, `max-forwards`,
2130+
`proxy-authorization`, `range`, `referer`,`retry-after`, `tk`,
2131+
`upgrade-insecure-requests`, `user-agent` or `x-content-type-options` are
2132+
discarded.
2133+
* `set-cookie` is a string if present once or an array in case duplicates
2134+
are present.
2135+
* `cookie`: the values are joined together with '; '.
2136+
* For all other headers, the values are joined together with ', '.
2137+
21212138
```js
21222139
const http2 = require('http2');
21232140
const server = http2.createServer();

0 commit comments

Comments
 (0)