mirror of
https://github.com/honojs/hono.git
synced 2024-11-21 18:18:57 +01:00
Add alb event null check for testing convenience
This commit is contained in:
parent
163657a411
commit
0be531f093
@ -407,7 +407,7 @@ class ALBProcessor extends EventProcessor<ALBProxyEvent> {
|
||||
|
||||
protected getQueryString(event: ALBProxyEvent): string {
|
||||
// In the case of ALB Integration either queryStringParameters or multiValueQueryStringParameters can be present not both
|
||||
/*
|
||||
/*
|
||||
In other cases like when using the serverless framework, the event object does contain both queryStringParameters and multiValueQueryStringParameters:
|
||||
Below is an example event object for this URL: /payment/b8c55e69?select=amount&select=currency
|
||||
{
|
||||
@ -471,7 +471,10 @@ export const getProcessor = (event: LambdaEvent): EventProcessor<LambdaEvent> =>
|
||||
}
|
||||
|
||||
const isProxyEventALB = (event: LambdaEvent): event is ALBProxyEvent => {
|
||||
return Object.hasOwn(event.requestContext, 'elb')
|
||||
if (event.requestContext) {
|
||||
return Object.hasOwn(event.requestContext, 'elb')
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
const isProxyEventV2 = (event: LambdaEvent): event is APIGatewayProxyEventV2 => {
|
||||
|
Loading…
Reference in New Issue
Block a user