HTTP API不会将Cookies转发到Lambda函数中

0

【以下的问题经过翻译处理】 Cookie头没有转发到Lambda

$ 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"}

Lambda代码;

exports.handler = async (event) => {
    const response = {
        statusCode: 200,
        body: JSON.stringify(event.headers) ,
    };
    return response;
};
profile picture
專家
已提問 5 個月前檢視次數 23 次
1 個回答
0

【以下的回答经过翻译处理】 您是否正在使用V2版本的负载中?在v2中,cookie被放置在event.cookies中:https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html

profile picture
專家
已回答 5 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南