PutBucketCors

Sets the CORS configuration for your bucket.

If the configuration exists, replace it.

You must have Full ACL to be able to call this action.

The following operations are related to PutBucketCors:

Request Syntax

 1PUT /?cors HTTP/1.1
 2Host: <BUCKET>.s3.tebi.io
 3
 4<?xml version="1.0" encoding="UTF-8"?>
 5<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
 6    <CORSRule>
 7        <AllowedHeader>string</AllowedHeader>
 8        ...
 9        <AllowedMethod>string</AllowedMethod>
10        ...
11        <AllowedOrigin>string</AllowedOrigin>
12        ...
13        <ExposeHeader>string</ExposeHeader>
14        ...
15        <ID>string</ID>
16        <MaxAgeSeconds>integer</MaxAgeSeconds>
17    </CORSRule>
18    ...
19</CORSConfiguration>

The request uses the following URI parameters:

  • <BUCKET>: Specifies the bucket impacted by the CORS configuration. Required.

The request accepts the following data in XML format:

  • CORSConfiguration: Root level tag for the CORSConfiguration parameters.

  • CORSRule: Set of origins and methods (cross-origin access that you want to allow).

Response Syntax

1HTTP/1.1 200
2Content-Length: 0

If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.

See Also

Refer here for more information.