-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Closed
Labels
docIssues and PRs related to the documentations.Issues and PRs related to the documentations.httpIssues or PRs related to the http subsystem.Issues or PRs related to the http subsystem.
Description
- Version: 8.1.2 (but applicable to others)
- Platform: all
- Subsystem: doc, http
ServerResponse.setHeader()specifies name asstringand value asstring | string[].ServerResponse.writeHead()allows an object for headers (key is header name, value is header value). All samples usestringfor keys andstring | string[]for values - except one which usesBuffer.byteLength(body)which is anumber(the sample works fine).ServerResponse.getHeader()specifies to return astring.
Actually getHeader() returns what as passed in so it should be at least string | string[].
But as setHeader() and writeHead() actually allow any stringifyable type you get also such type back as the conversion to string happens when writing the outgoing stream not during storing the header.
Not sure here if this is worth a change; and if yes should it be in doc or code?
I would guess the same is applicable to ClientRequest.
Metadata
Metadata
Assignees
Labels
docIssues and PRs related to the documentations.Issues and PRs related to the documentations.httpIssues or PRs related to the http subsystem.Issues or PRs related to the http subsystem.