We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Following the pattern outlined here of setting multiple headers works in local node environment: remix-run/remix#231
return json( { success: true }, { headers: [ ["Set-Cookie", await commiSession1()], ["Set-Cookie", await commiSession2()] ] } )
However, when running using the createRequestHandler from this package (only tried using AWSProxy.APIGatewayV1) only the last cookie is set.
Looking at the code it may be because you are not returning multiValueHeaders, just headers
multiValueHeaders
headers
https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
The text was updated successfully, but these errors were encountered:
@MattyBalaam hmm I would expect remix to return a valid Headers object, which would mean it should return the following
HeadersList { cookies: [ 'cookie1=value1', 'cookie2=value2' ], [Symbol(headers map)]: Map(1) { 'set-cookie' => { name: 'Set-Cookie', value: 'cookie1=value1, cookie2=value2' } }, [Symbol(headers map sorted)]: null }
👉 https://replit.com/@wingleung1/UnripeSunnyProgrammers
But what I receive from remix is an object containing an array value in headers, which is not compliant with the apigwV1 model
headers: { 'content-type': 'text/html', 'set-cookie': [ 'cookie1=chocolate-chip', 'cookie2=oatmeal' ] }
Created a PR with a workaround 👉 #15
meantime, could you try using comma delimiters?
const session1 = await commiSession1() const session2 = await commiSession2() return json( { success: true }, { headers: { "Set-Cookie": `${session1}, ${session2}` } } )
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Following the pattern outlined here of setting multiple headers works in local node environment: remix-run/remix#231
However, when running using the createRequestHandler from this package (only tried using AWSProxy.APIGatewayV1) only the last cookie is set.
Looking at the code it may be because you are not returning
multiValueHeaders
, justheaders
https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
The text was updated successfully, but these errors were encountered: