Skip to main content

GetBucketCors

Returns the Cross-Origin Resource Sharing (CORS) configuration of a bucket.

Description​

The GetBucketCors operation returns the CORS configuration information set for the bucket. To use this operation, you must have s3:GetBucketCORS permissions on the bucket, or be the bucket owner.

note

If the bucket doesn't have a CORS configuration, this operation returns an empty CORSConfiguration element.

Request Syntax​

GET /?cors HTTP/1.1
Host: BucketName.qstorage.quilibrium.com
x-amz-expected-bucket-owner: OwnerAccountId
Values in italics indicate user input and should be replaced with actual values.

This operation does not have a request body.

Request Parameters​

Headers​

NameDescriptionRequiredType
x-amz-expected-bucket-ownerThe account ID of the expected bucket ownerNotext

Examples​

GET /?cors HTTP/1.1
Host: my-bucket.qstorage.quilibrium.com
x-amz-expected-bucket-owner: 123456789012
Values in italics indicate user input and should be replaced with actual values.
HTTP/1.1 200 OK
x-amz-id-2: Example7qoYGN7uMuFuYS6m7a4l
x-amz-request-id: TX234S0F24A06C7
Date: Wed, 01 Mar 2024 12:00:00 GMT
<?xml version="1.0" encoding="UTF-8"?> <CORSConfiguration> <CORSRule> <AllowedOrigin>https://example.com</AllowedOrigin> <AllowedMethod>GET</AllowedMethod> <AllowedMethod>PUT</AllowedMethod> <AllowedHeader>*</AllowedHeader> <MaxAgeSeconds>3000</MaxAgeSeconds> <ExposeHeader>ETag</ExposeHeader> </CORSRule> </CORSConfiguration>
Values in italics indicate variable response values.

Response Syntax​

HTTP/1.1 200 OK
x-amz-id-2: RequestId
x-amz-request-id: AmazonRequestId
Date: ISO8601Date
<?xml version="1.0" encoding="UTF-8"?> <CORSConfiguration> <CORSRule> <AllowedOrigin>AllowedOrigin</AllowedOrigin> <AllowedMethod>AllowedMethod</AllowedMethod> <AllowedHeader>AllowedHeader</AllowedHeader> <MaxAgeSeconds>MaxAgeSeconds</MaxAgeSeconds> <ExposeHeader>ExposeHeader</ExposeHeader> </CORSRule> </CORSConfiguration>
Values in italics indicate variable response values.

Response Elements​

Response Headers​

NameDescriptionRequiredType
x-amz-id-2An identifier for the requestNoString
x-amz-request-idA unique identifier for the requestNoString
DateThe date and time at which the response was sentNoString

Response Body Elements​

NameTypeDescriptionRequired
CORSConfigurationContainerContainer for the bucket's CORS configurationYes
CORSRuleCORSRuleA set of origins and methods (cross-origin access that you want to allow). You can add up to 100 rules to the configuration.No

Special Errors​

Error CodeDescription
NoSuchBucketThe specified bucket does not exist
403Forbidden. Authentication failed or you do not have permission to access the bucket CORS configuration

Permissions​

You must have the s3:GetBucketCors permission.

Try It Out​

Test GetBucketCors

Get the CORS configuration of a bucket.

Coming Soon

This feature is currently under development and will be available soon.