fixed merge error. Tests all passing

This commit is contained in:
eL0ck 2016-09-26 15:29:22 +10:00 committed by Florian Motlik
parent 228d52cc7c
commit dc0b252564

View File

@ -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);
}