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年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ