Actions
Bug #44678
openCan not set CORS via AWS S3 API
% Done:
0%
Source:
Community (user)
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
rgw
Pull request ID:
Crash signature (v1):
Crash signature (v2):
Description
We use ceph and radosgw to access our storage via the s3 java api. When we try to set a CORS rule, the java api returns an AmazonS3Exception (printing out "null") with the error code MalformedXML (debugging shows that none of the fields of my CORSRule objects has a field that is null).
I was exactly following the s3 guide here: https://docs.amazonaws.cn/en_us/AmazonS3/latest/dev/ManageCorsUsingJava.html
This is my implementation:
private void setCORS() {
List<CORSRule> corsRules = new ArrayList<>();
corsRules.add(new CORSRule().withAllowedOrigins(Arrays.asList("*ROCKET_CHAT_DOMAIN*")). //
withAllowedMethods(Arrays.asList(AllowedMethods.PUT, AllowedMethods.POST, AllowedMethods.GET, AllowedMethods.HEAD)). //
withMaxAgeSeconds(3000). //
withAllowedHeaders(Arrays.asList("*")));
s3Client.setBucketCrossOriginConfiguration(cephBucket, new BucketCrossOriginConfiguration(corsRules));
}
Strange is that the windows tool S3 browser returns the exact same result when I try to create the CORS rule.
Does anybody have experinece setting CORS rules via radosgw in ceph? Optimally using the S3 libraries?
Actions