Get CORS Rules

Read the cross-origin (CORS) configuration of a bucket you own.
EndpointMethodAdmin Required
/api/v1/buckets/:bucketName/corsGETNo

Returns the CORS rules of a bucket you own. A bucket with no configuration returns an empty rules array, not an error. This is the same configuration the S3 GET ?cors subresource returns as XML.

Path Parameters

bucketName
string required
The name of the bucket.

Response

{
    "rules": [
        {
            "id": "web-app",
            "allowedOrigins": ["https://app.example.com"],
            "allowedMethods": ["GET", "PUT"],
            "allowedHeaders": ["*"],
            "exposeHeaders": ["ETag"],
            "maxAgeSeconds": 3600
        }
    ]
}

See Set CORS Rules for the rule fields.

Errors

StatusReason
400Missing bucket name
404Bucket not found (or not owned by you)