Skip to content

Commit 2fa499b

Browse files
NilSetzcbenzmalept
authored
docs: update type and description of IncomingMessage.headers (electron#22522)
* docs: update type and description of IncomingMessage.headers Fixes electron#22521 Updates the docs for IncomingMessage.headers to match the changes made in electron#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>
1 parent 66c1572 commit 2fa499b

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

docs/api/incoming-message.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,17 @@ A `String` representing the HTTP status message.
5151

5252
#### `response.headers`
5353

54-
An `Record<string, string[]>` representing the response HTTP headers. The `headers` object is
54+
A `Record<string, string | string[]>` representing the HTTP response headers. The `headers` object is
5555
formatted as follows:
5656

5757
* All header names are lowercased.
58-
* Each header name produces an array-valued property on the headers object.
59-
* Each header value is pushed into the array associated with its header name.
58+
* Duplicates of `age`, `authorization`, `content-length`, `content-type`,
59+
`etag`, `expires`, `from`, `host`, `if-modified-since`, `if-unmodified-since`,
60+
`last-modified`, `location`, `max-forwards`, `proxy-authorization`, `referer`,
61+
`retry-after`, `server`, or `user-agent` are discarded.
62+
* `set-cookie` is always an array. Duplicates are added to the array.
63+
* For duplicate `cookie` headers, the values are joined together with '; '.
64+
* For all other headers, the values are joined together with ', '.
6065

6166
#### `response.httpVersion`
6267

0 commit comments

Comments
 (0)