diff --git a/dispatch-config.js b/dispatch-config.js index c43eb81..068fc75 100644 --- a/dispatch-config.js +++ b/dispatch-config.js @@ -31,8 +31,8 @@ export default [ { check: e => e.type === 'TOKEN' && e.methodArn, handler: './handlers/handleAuthorizerV1.js' }, { check: e => e.version === '2.0' && e.type === 'REQUEST', handler: './handlers/handleAuthorizerV2.js' }, { check: e => e.version === '2.0' && e.requestContext?.http?.method, handler: './handlers/handleHttpV2.js' }, - { check: e => e.httpMethod, handler: './handlers/handleHttpV1.js' }, { check: e => e.requestContext?.elb, handler: './handlers/handleAlb.js' }, + { check: e => e.httpMethod, handler: './handlers/handleHttpV1.js' }, { check: e => e.Records && e.Records[0]?.cf, handler: './handlers/handleEdge.js' }, { check: e => e.awslogs?.data, handler: './handlers/handleCloudWatchLogs.js' }, { check: e => e.RequestType && e.ResponseURL, handler: './handlers/handleCustomResource.js' }, diff --git a/tests/handlers.test.js b/tests/handlers.test.js index d97e3f3..5a24e11 100644 --- a/tests/handlers.test.js +++ b/tests/handlers.test.js @@ -105,7 +105,7 @@ describe('handler dispatch', () => { }); test('handles ALB event', async () => { - const event = { requestContext: { elb: {} }, path: '/alb' }; + const event = { requestContext: { elb: {} }, httpMethod: 'GET', path: '/alb' }; const context = { awsRequestId: '1' }; const result = await handler(event, context); expect(result).toEqual({