Skip to content

Commit

Permalink
fix(aws-lambda-streaming): fix global lambda import pointing to wrong (
Browse files Browse the repository at this point in the history
  • Loading branch information
thdxr authored May 7, 2024
1 parent 9fcaca6 commit 346a495
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/runtime/entries/aws-lambda-streaming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {

declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace awslambda2 {
namespace awslambda {
// https://docs.aws.amazon.com/lambda/latest/dg/configuration-response-streaming.html
function streamifyResponse(
handler: (
Expand All @@ -36,14 +36,13 @@ declare global {
}
}

export const handler = awslambda2.streamifyResponse(
async (event, responseStream, context) => {
export const handler = awslambda.streamifyResponse(
async (event: APIGatewayProxyEventV2, responseStream, context) => {
const query = {
...event.queryStringParameters,
};
const url = withQuery(event.rawPath, query);
const method =
(event as APIGatewayProxyEventV2).requestContext?.http?.method || "get";
const method = event.requestContext?.http?.method || "get";

if ("cookies" in event && event.cookies) {
event.headers.cookie = event.cookies.join(";");
Expand Down

0 comments on commit 346a495

Please sign in to comment.