docs: update type and description of IncomingMessage.headers (#22522)

* docs: update type and description of IncomingMessage.headers

Fixes #22521

Updates the docs for IncomingMessage.headers to match the changes made in #17517

* Update docs/api/incoming-message.md

Co-Authored-By: Mark Lee <malept@users.noreply.github.com>

Co-authored-by: Cheng Zhao <zcbenz@electronjs.org>
Co-authored-by: Mark Lee <malept@users.noreply.github.com>
This commit is contained in:
Thomas Levy 2020-03-17 19:32:26 -07:00 committed by GitHub
parent 66c15721d8
commit 2fa499b682
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -51,12 +51,17 @@ A `String` representing the HTTP status message.
#### `response.headers` #### `response.headers`
An `Record<string, string[]>` representing the response HTTP headers. The `headers` object is A `Record<string, string | string[]>` representing the HTTP response headers. The `headers` object is
formatted as follows: formatted as follows:
* All header names are lowercased. * All header names are lowercased.
* Each header name produces an array-valued property on the headers object. * Duplicates of `age`, `authorization`, `content-length`, `content-type`,
* Each header value is pushed into the array associated with its header name. `etag`, `expires`, `from`, `host`, `if-modified-since`, `if-unmodified-since`,
`last-modified`, `location`, `max-forwards`, `proxy-authorization`, `referer`,
`retry-after`, `server`, or `user-agent` are discarded.
* `set-cookie` is always an array. Duplicates are added to the array.
* For duplicate `cookie` headers, the values are joined together with '; '.
* For all other headers, the values are joined together with ', '.
#### `response.httpVersion` #### `response.httpVersion`