Skip to content

Commit cfc2693

Browse files
committed
Set max age cors headers
1 parent 5d69352 commit cfc2693

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/deploy/events/apiGateway/validate.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ module.exports = {
2626
cors.origin = http.cors.origin || '*';
2727
cors.allowCredentials = cors.allowCredentials || http.cors.allowCredentials;
2828

29+
// when merging, last one defined wins
30+
if (_.has(http.cors, 'maxAge')) {
31+
cors.maxAge = http.cors.maxAge;
32+
}
33+
2934
corsPreflight[http.path] = cors;
3035
}
3136

0 commit comments

Comments
 (0)