Get CORS Rules
Read the cross-origin (CORS) configuration of a bucket you own.
| Endpoint | Method | Admin Required |
|---|---|---|
/api/v1/buckets/:bucketName/cors | GET | No |
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
| Status | Reason |
|---|---|
400 | Missing bucket name |
404 | Bucket not found (or not owned by you) |