-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
Closed
Closed
Copy link
Labels
docIssues and PRs related to the documentations.Issues and PRs related to the documentations.good first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.httpIssues or PRs related to the http subsystem.Issues or PRs related to the http subsystem.
Description
- Version: 6.9.1
- Platform: Linux 4.4.0-21-generic logo ideas #37-Ubuntu SMP x86_64 x86_64 x86_64 GNU/Linux
- Subsystem: http
In short, calling writeHead()
with a ServerResponse
object which has no headers already set causes getHeader()
to return undefined
even if the header was set in the writeHead()
function call. I am unfamiliar with the project, so I'm unsure if this is defined behavior or not.
//Case 1: using setHeader, getHeader works as intended
res.setHeader("Location", "index.html");
res.getHeader("Location"); //index.html
//Case 2: using setHeader then writeHead, getHeader works as intended
res.setHeader("Set-Cookie", "hello=world");
res.writeHead(303, {Location: "index.html"});
res.getHeader("Location"); //index.html
//Case 3: using writeHead when res._headers is null, getHeader does not work as intended
res.writeHead(303, {Location: "index.html"});
res.getHeader("Location"); //undefined
strarsis and JoseCage
Metadata
Metadata
Assignees
Labels
docIssues and PRs related to the documentations.Issues and PRs related to the documentations.good first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.httpIssues or PRs related to the http subsystem.Issues or PRs related to the http subsystem.