File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import { Headers , Request as PonyFillRequest } from '@whatwg-node/fetch'
1+ import { Headers } from '@whatwg-node/fetch'
22import type { APIGatewayProxyEvent } from 'aws-lambda'
33
44// This is part of the request, dreived either from a LambdaEvent or FetchAPI Request
@@ -50,14 +50,13 @@ export const parseFetchEventBody = async (event: Request) => {
5050export const isFetchApiRequest = (
5151 event : Request | APIGatewayProxyEvent
5252) : event is Request => {
53- if (
54- event . constructor . name === 'Request' ||
55- event . constructor . name === PonyFillRequest . name
56- ) {
57- return true
53+ // Arda has suggested it's better to check for a lambda event than a fetch event
54+ // as there are some edgecases with constructor name in PonyfillRequest
55+ if ( 'httpMethod' in event || 'resource' in event ) {
56+ return false
5857 }
5958
60- return false
59+ return true
6160}
6261
6362function getQueryStringParams ( reqUrl : string ) {
You can’t perform that action at this time.
0 commit comments