HTTP API doesn't forward Cookies to Lambdas

0

Cookie headers are not forwarded to Lambdas

$ curl -H "Cookie: test" https://redacted.execute-api.us-east-2.amazonaws.com

{"accept":"*/*","content-length":"0","host":"redacted.execute-api.us-east-2.amazonaws.com","user-agent":"curl/7.58.0","x-amzn-trace-id":"Root=1-5ed6b365-97645c08fe07add8b0a75568","x-forwarded-for":"redacted","x-forwarded-port":"443","x-forwarded-proto":"https"}

Lamda

exports.handler = async (event) => {
    const response = {
        statusCode: 200,
        body: JSON.stringify(event.headers) ,
    };
    return response;
};
1개 답변
0
수락된 답변

Are you using Payload Format Version 2? In v2, cookies are put into event.cookies: https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html

AWS
답변함 4년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠