Skip to content

Commit

Permalink
fix: cookies of request for aws lambda payload format v2 (#159)
Browse files Browse the repository at this point in the history
* fix: cookies of request for aws lambda

* fix: extra check for cookies of aws lambda payload v2
  • Loading branch information
princescar authored Nov 30, 2024
1 parent b06cb2a commit 66ce13e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/adapter/adapter-aws-lambda/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ export default function awsLambdaAdapter(
event.rawPath +
(event.rawQueryString ? "?" + event.rawQueryString : "");

if (
typeof event.headers.cookie === "undefined" &&
event.cookies != null &&
event.cookies.length > 0
) {
event.headers["cookie"] = event.cookies.join("; ");
}

const ctx: AdapterRequestContext<AwsLambdaPlatformInfo> = {
request: new Request(url, {
method: event.requestContext?.http?.method || "GET",
Expand Down

0 comments on commit 66ce13e

Please sign in to comment.