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

Request cookie header should be semi-colon delimitated #39

Merged
merged 3 commits into from
Jan 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/node-bridge/src/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function normalizeAPIGatewayProxyEvent(
// API Gateway 2.0 payload splits cookie header from the rest,
// so we need to readd them
if (cookies) {
headers['cookie'] = cookies.join(', ');
headers['cookie'] = cookies.join('; ');
}

if (body) {
Expand Down
4 changes: 2 additions & 2 deletions packages/node-bridge/test/bridge.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ test('[APIGatewayProxyEvent] cookie handling', async () => {

const result = await bridge.launcher(
{
cookies: ['cookie-1, cookie-2', 'cookie-3'],
cookies: ['cookie-1; cookie-2', 'cookie-3'],
rawPath: '/__NEXT_PAGE_LAMBDA_0/',
requestContext: {
http: {
Expand All @@ -112,7 +112,7 @@ test('[APIGatewayProxyEvent] cookie handling', async () => {
const body = JSON.parse(Buffer.from(result.body, 'base64').toString());
expect(body.method).toBe('POST');
expect(body.path).toBe('/');
expect(body.headers.cookie).toBe('cookie-1, cookie-2, cookie-3');
expect(body.headers.cookie).toBe('cookie-1; cookie-2; cookie-3');
ofhouse marked this conversation as resolved.
Show resolved Hide resolved

server.close();
});
Expand Down