diff --git a/lib/classes/Utils.js b/lib/classes/Utils.js index a0a44112b..270016409 100644 --- a/lib/classes/Utils.js +++ b/lib/classes/Utils.js @@ -220,9 +220,9 @@ class Utils { if (_.has(event, 'http.authorizer')) { if ( (_.isString(event.http.authorizer) && - _.toUpper(event.http.authorizer) === 'AWS_IAM') || + event.http.authorizer.toUpperCase() === 'AWS_IAM') || (event.http.authorizer.type && - _.toUpper(event.http.authorizer.type) === 'AWS_IAM') + event.http.authorizer.type.toUpperCase() === 'AWS_IAM') ) { hasIAMAuthorizer = true; } @@ -235,7 +235,7 @@ class Utils { if ( (_.isString(event.http.authorizer) && - _.toUpper(event.http.authorizer) !== 'AWS_IAM' && + event.http.authorizer.toUpperCase() !== 'AWS_IAM' && !awsArnRegExs.cognitoIdpArnExpr.test(event.http.authorizer)) || event.http.authorizer.name || (event.http.authorizer.arn && diff --git a/lib/plugins/aws/package/compile/events/apiGateway/lib/method/integration.js b/lib/plugins/aws/package/compile/events/apiGateway/lib/method/integration.js index 94bcbbf75..65b396727 100644 --- a/lib/plugins/aws/package/compile/events/apiGateway/lib/method/integration.js +++ b/lib/plugins/aws/package/compile/events/apiGateway/lib/method/integration.js @@ -82,9 +82,10 @@ module.exports = { }, }); } else if (type === 'HTTP' || type === 'HTTP_PROXY') { + const integrationHttpMethod = (http.request && http.request.method) || http.method; Object.assign(integration, { Uri: http.request && http.request.uri, - IntegrationHttpMethod: _.toUpper((http.request && http.request.method) || http.method), + IntegrationHttpMethod: integrationHttpMethod.toUpperCase(), }); if (http.connectionType) { Object.assign(integration, {