mc cors get
The mc cors get
command retrieves and displays the Cross-Origin Resource Sharing (CORS) configuration for a bucket in XML format.
CORS is a browser security mechanism that controls which web domains can access your object storage from client-side JavaScript. When a web application running on one domain attempts to access objects in AIStor from a different domain, the browser checks CORS policies to determine if the request should be allowed. See the Mozilla CORS documentation for more information.
Syntax
Parameters
ALIAS
Required
The alias of the AIStor or other S3-compatible service.
BUCKET
Required
The name of the bucket from which to retrieve the CORS configuration.
Global flags
This command supports any of the global flags.
Examples
Get CORS configuration for a bucket
Use mc cors get
to retrieve the CORS configuration:
mc cors get myaistor/mybucket
- Replace
myaistor
with thealias
of a configured S3-compatible host. - Replace
mybucket
with the name of the bucket.
If no CORS configuration exists, the command returns:
No bucket CORS configuration found.
Save CORS configuration to a file
Redirect the output to save the CORS configuration:
mc cors get myaistor/mybucket > cors-backup.xml
Behavior
S3 compatibility
The mc
commandline tool is built for compatibility with the AWS S3 API and is tested with AIStor and AWS S3 for expected functionality and behavior.
MinIO provides no guarantees for other S3-compatible services, as their S3 API implementation is unknown and therefore unsupported.
While mc
commands may work as documented, any such usage is at your own risk.
No configuration found
If the bucket has no CORS configuration, the command displays a message indicating no configuration exists. In this case, the bucket uses global CORS settings.