Skip to content

Commit

Permalink
doc: Improve doc for Http2 headers object
Browse files Browse the repository at this point in the history
Add more details regarding processing and data type of incoming
headers in Http2.

PR-URL: nodejs#21296
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
  • Loading branch information
Flarna authored and kjin committed Oct 16, 2018
1 parent f8ca564 commit 9e64f91
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions doc/api/http2.md
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 9e64f91

Please sign in to comment.