Skip to content

Commit 4228141

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

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

doc/api/http2.md

+17
Original file line numberDiff line numberDiff line change
@@ -2120,6 +2120,23 @@ prototype. This means that normal JavaScript object methods such as
21202120
`Object.prototype.toString()` and `Object.prototype.hasOwnProperty()` will
21212121
not work.
21222122

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

0 commit comments

Comments
 (0)