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

fix(dev): prevent comma-separating multiple Set-Cookie headers #9884

Merged
merged 3 commits into from
Jan 31, 2024

Conversation

lilnasy
Copy link
Contributor

@lilnasy lilnasy commented Jan 30, 2024

Changes

Testing

Added a unit test.

Docs

Does not affect usage.

Copy link

changeset-bot bot commented Jan 30, 2024

🦋 Changeset detected

Latest commit: 96eb8d7

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Jan 30, 2024
} else {
_headers['set-cookie'] = headers.get('set-cookie')!;
}
_headers['set-cookie'] = headers.getSetCookie();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix is this one line, the rest is clerical.

Comment on lines +14 to +23
'/src/pages/index.js': `export const GET = () => {
const headers = new Headers();
headers.append('x-single', 'single');
headers.append('x-triple', 'one');
headers.append('x-triple', 'two');
headers.append('x-triple', 'three');
headers.append('Set-cookie', 'hello');
headers.append('Set-Cookie', 'world');
return new Response(null, { headers });
}`,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copied over from the NodeApp unit test.

Copy link
Contributor

@matthewp matthewp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done

@ematipico ematipico merged commit 3736955 into withastro:main Jan 31, 2024
13 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Jan 31, 2024
@lilnasy lilnasy deleted the fix/9874 branch February 7, 2024 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set-Cookie headers are concatenated, and are not working correctly
3 participants