-
Notifications
You must be signed in to change notification settings - Fork 82
fix ceph CORS tests failure #8968
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -719,8 +719,8 @@ function set_cors_headers_s3(req, res, cors_rules) { | |
// https://docs.aws.amazon.com/AmazonS3/latest/API/RESTCommonResponseHeaders.html | ||
dbg.log0('set_cors_headers_s3: found matching CORS rule:', matched_rule); | ||
set_cors_headers(req, res, { | ||
allow_origin: matched_rule.allowed_origins.includes('*') ? '*' : req.headers.origin, | ||
allow_methods: matched_rule.allowed_methods.join(','), | ||
allow_origin: match_origin, | ||
allow_methods: match_method, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is also not correct - take a look at the above example There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree, this was not the correct solution to the problem. |
||
allow_headers: matched_rule.allowed_headers?.join(','), | ||
expose_headers: matched_rule.expose_headers?.join(','), | ||
allow_credentials: 'true', | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not correct. in case you have * in the allowed_origin list - you need to return * and not the sent origin - see here:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is tested with AWS. let me know if you need the script for running request with AWS bucket
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also see your change cause another s3_test to fail about CORS:
test_cors_origin_wildcard
please check in advance all of the tests are passing.