Skip to content

Commit 6b6d3fb

Browse files
committed
fixing max_age_seconds to number and not string
Signed-off-by: jackyalbo <jacky.albo@gmail.com>
1 parent 65e2df2 commit 6b6d3fb

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/endpoint/s3/ops/s3_put_bucket_cors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ async function put_bucket_cors(req) {
1414
allowed_origins: rule.AllowedOrigin,
1515
expose_headers: rule.ExposeHeader,
1616
id: rule.ID,
17-
max_age_seconds: rule.MaxAgeSeconds,
17+
max_age_seconds: rule.MaxAgeSeconds && parseInt(rule.MaxAgeSeconds, 10),
1818
}, _.isUndefined)
1919
);
2020
await req.object_sdk.put_bucket_cors({

src/util/http_utils.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,7 @@ function set_cors_headers_s3(req, res, cors_rules) {
673673
}));
674674
if (matched_rule) {
675675
// https://docs.aws.amazon.com/AmazonS3/latest/API/RESTCommonResponseHeaders.html
676+
dbg.log0('set_cors_headers_s3: found matching CORS rule:', matched_rule);
676677
set_cors_headers(req, res, {
677678
allow_origin: matched_rule.allowed_origins.includes('*') ? '*' : req.headers.origin,
678679
allow_methods: matched_rule.allowed_methods.join(','),

0 commit comments

Comments
 (0)