File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed
Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @as-integrations/aws-lambda ' : patch
3+ ---
4+
5+ Correctly recognize gateway v1 events
Original file line number Diff line number Diff line change @@ -30,6 +30,8 @@ function v1EventFromRequest(
3030
3131 // simplify the V1 event down to what our integration actually cares about
3232 const event : Partial < APIGatewayProxyEvent > = {
33+ // @ts -expect-error (version actually can exist on v1 events, this seems to be a typing error)
34+ version : "1.0" ,
3335 httpMethod : req . method ! ,
3436 headers : Object . fromEntries (
3537 Object . entries ( req . headers ) . map ( ( [ name , value ] ) => {
Original file line number Diff line number Diff line change @@ -102,7 +102,11 @@ function normalizeGatewayEvent(event: GatewayEvent): HTTPGraphQLRequest {
102102}
103103
104104function isV1Event ( event : GatewayEvent ) : event is APIGatewayProxyEvent {
105- return ! ( 'version' in event ) ;
105+ // APIGatewayProxyEvent incorrectly omits `version` even though API Gateway v1
106+ // events may include `version: "1.0"`
107+ return (
108+ ! ( 'version' in event ) || ( 'version' in event && event . version === '1.0' )
109+ ) ;
106110}
107111
108112function isV2Event ( event : GatewayEvent ) : event is APIGatewayProxyEventV2 {
You can’t perform that action at this time.
0 commit comments