claudia-api-builder
Advanced tools
Comparing version 3.0.0 to 3.0.1
{ | ||
"name": "claudia-api-builder", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "Simplify AWS ApiGateway handling", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -172,3 +172,3 @@ const util = require('util'), | ||
getCorsHeaders = function (request, methods) { | ||
if (methods.indexOf('ANY') >= 0) { | ||
if (methods.indexOf('ANY') >= 0 || methods.length === 0) { | ||
methods = supportedMethods; | ||
@@ -185,11 +185,11 @@ } | ||
}) | ||
.then(corsOrigin => { | ||
return { | ||
'Access-Control-Allow-Origin': corsOrigin, | ||
'Access-Control-Allow-Headers': corsOrigin && (customCorsHeaders || 'Content-Type,Authorization,X-Amz-Date,X-Api-Key,X-Amz-Security-Token'), | ||
'Access-Control-Allow-Methods': corsOrigin && methods.sort().join(',') + ',OPTIONS', | ||
'Access-Control-Allow-Credentials': corsOrigin && 'true', | ||
'Access-Control-Max-Age': customCorsMaxAge || 0 | ||
}; | ||
}); | ||
.then(corsOrigin => { | ||
return { | ||
'Access-Control-Allow-Origin': corsOrigin, | ||
'Access-Control-Allow-Headers': corsOrigin && (customCorsHeaders || 'Content-Type,Authorization,X-Amz-Date,X-Api-Key,X-Amz-Security-Token'), | ||
'Access-Control-Allow-Methods': corsOrigin && methods.sort().join(',') + ',OPTIONS', | ||
'Access-Control-Allow-Credentials': corsOrigin && 'true', | ||
'Access-Control-Max-Age': customCorsMaxAge || 0 | ||
}; | ||
}); | ||
}, | ||
@@ -196,0 +196,0 @@ routeEvent = function (routingInfo, event, context) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29760