Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple "set-cookie" headers get merged into one #23662

Open
bageren opened this issue May 2, 2024 · 0 comments
Open

Multiple "set-cookie" headers get merged into one #23662

bageren opened this issue May 2, 2024 · 0 comments
Labels
bug Something isn't working node compat

Comments

@bageren
Copy link

bageren commented May 2, 2024

import { default as express } from "npm:[email protected]";

const app = express();
const port = 3000;

app.get("/", (req, res) => {
  res.header("set-cookie", ["test1=1; Path=/;", "test2=2; Path=/;"]);
  res.send("Hello World!");
});

When I open localhost:3000, I see set-cookie: test1=1; Path=/;,test2=2; Path=/; in the response headers. This causes only the first one (test1) to be set, while test2 is ignored.

The expected result would be 2 set-cookie headers in the response:

set-cookie: test1=1; Path=/;
set-cookie: test2=2; Path=/;

Doing the exact same thing using Node v18.17.0 produces the expected result.

Version: Deno 1.41.3

@bageren bageren changed the title Multiple "Set-Cookie" headers get merged into one Multiple "set-cookie" headers get merged into one May 3, 2024
@dsherret dsherret added bug Something isn't working node compat labels May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working node compat
Projects
None yet
Development

No branches or pull requests

2 participants