diff --git a/lib/plugins/aws/deploy/compile/events/apiGateway/lib/validate.js b/lib/plugins/aws/deploy/compile/events/apiGateway/lib/validate.js index 0bb5621d4..d2e9e9c33 100644 --- a/lib/plugins/aws/deploy/compile/events/apiGateway/lib/validate.js +++ b/lib/plugins/aws/deploy/compile/events/apiGateway/lib/validate.js @@ -43,13 +43,15 @@ module.exports = { throw new this.serverless.classes .Error(errorMessage); } + method = method.toLowerCase(); + const allowedMethods = [ 'get', 'post', 'put', 'patch', 'options', 'head', 'delete', 'any', ]; if (allowedMethods.indexOf(method) === -1) { const errorMessage = [ `Invalid APIG method "${method}" in function "${functionName}".`, - ` AWS supported methods are: ${allowedMethods.join(", ")}.`, + ` AWS supported methods are: ${allowedMethods.join(', ')}.`, ].join(''); throw new this.serverless.classes.Error(errorMessage); }