Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(aws-lambda-streaming): fix global lambda import pointing to wrong #2422

Merged
merged 1 commit into from
May 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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