CORS
Cross Origin Resource Sharing Configuration
Returns the cors configuration information set for the bucket. To use this operation, you must have permission to perform the GetBucketCORS operation. By default, the bucket owner has this permission and can grant it to others.
S3 API Compatibility - The x-amz-expected-bucket-owner header isn't supported.
IONOS CLOUD Object Storage API requests are authenticated using the AWS signature. The IONOS CLOUD Object Storage API authenticates users using a customized HTTP scheme based on a keyed-HMAC (Hash Message Authentication Code). The process of generating the proper Authorization header is somewhat involved. We recommend that you make use of a tool such as Postman.
In the Authorization tab for a request, select AWS Signature from the Type dropdown list. Specify where Postman should append your authorization data using the Add authorization data to drop-down menu.
-
If you select Request Headers, Postman populates the Headers tab with Authorization and
X-Amz-prefixed fields. -
If you select Request URL, Postman populates the Params tab with authentication details prefixed with
X-Amz-.
Note: The parameters listed below contain confidential information. We recommend using variables to keep this data secure while working in a collaborative environment.
-
For Access Key, enter your
access keydirectly in the fields or through variables for added security. -
For Secret Key, enter your
secret keydirectly in the fields or through variables for added security.
Advanced fields are optional, but Postman will attempt to generate them automatically if necessary.
-
For AWS Region, enter one of the regions (
eu-central-3) where your bucket is hosted. -
For Service Name, enter
s3. The name of the service that receives the requests. -
For Session Token, leave the field blank. This is only required when temporary security credentials are used.
The bucket name.
my-bucketSuccess
GET /{Bucket}?cors?cors=true HTTP/1.1
Host: s3.eu-central-3.ionoscloud.com
Authorization: YOUR_API_KEY
Accept: */*
Success
<CORSConfiguration>
<CORSRule>
<AllowedOrigin>https://www.domain.com</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>
Sets the `CORS` configuration for your bucket. If the configuration exists, it will be overwritten and replaced.
To use this operation, you must be allowed to perform the `PutBucketCORS` operation. By default, the bucket owner has this permission and can grant it to others.
You set this configuration on a bucket so that the bucket can service cross-origin requests. For example, you might want to enable a request whose origin is `http://www.example.com` to access your IONOS CLOUD Object Storage bucket at `my.example.bucket.com` by using the browser's `XMLHttpRequest` capability.
To enable cross-origin resource sharing (CORS) on a bucket, you add the `cors` subresource to the bucket. The `cors` subresource is an XML document in which you configure rules that identify origins and the HTTP methods that can be executed on your bucket. The document is limited to 64 KB in size.
When IONOS CLOUD Object Storage receives a cross-origin request (or a pre-flight OPTIONS request) against a bucket, it evaluates the `cors` configuration on the bucket and uses the first `CORSRule` rule that matches the incoming browser request to enable a cross-origin request. For a rule to match, the following conditions must be met:
The request's `Origin` header must match `AllowedOrigin` elements.
The request method (for example, GET, PUT, HEAD, and so on) or the `Access-Control-Request-Method` header in case of a pre-flight `OPTIONS` request must be one of the `AllowedMethod` elements.
Every header specified in the `Access-Control-Request-Headers` request header of a pre-flight request must match an `AllowedHeader` element.
IONOS CLOUD Object Storage API requests are authenticated using the AWS signature. The IONOS CLOUD Object Storage API authenticates users using a customized HTTP scheme based on a keyed-HMAC (Hash Message Authentication Code). The process of generating the proper Authorization header is somewhat involved. We recommend that you make use of a tool such as Postman.
In the Authorization tab for a request, select AWS Signature from the Type dropdown list. Specify where Postman should append your authorization data using the Add authorization data to drop-down menu.
-
If you select Request Headers, Postman populates the Headers tab with Authorization and
X-Amz-prefixed fields. -
If you select Request URL, Postman populates the Params tab with authentication details prefixed with
X-Amz-.
Note: The parameters listed below contain confidential information. We recommend using variables to keep this data secure while working in a collaborative environment.
-
For Access Key, enter your
access keydirectly in the fields or through variables for added security. -
For Secret Key, enter your
secret keydirectly in the fields or through variables for added security.
Advanced fields are optional, but Postman will attempt to generate them automatically if necessary.
-
For AWS Region, enter one of the regions (
eu-central-3) where your bucket is hosted. -
For Service Name, enter
s3. The name of the service that receives the requests. -
For Session Token, leave the field blank. This is only required when temporary security credentials are used.
The bucket name.
my-bucketThe base64 encoded MD5 digest of the message (without the headers) according to RFC 1864.
Success
PUT /{Bucket}?cors?cors=true HTTP/1.1
Host: s3.eu-central-3.ionoscloud.com
Authorization: YOUR_API_KEY
Content-Type: application/xml
Accept: */*
Content-Length: 227
"<CORSConfiguration>
<CORSRule>
<AllowedOrigin>https://www.domain.com</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>
"Success
No content
Deletes the CORS configuration information set for the bucket.
To use this operation, you must have permission to perform the PutBucketCORS operation. The bucket owner has this permission by default and can grant this permission to others.
S3 API Compatibility - The x-amz-expected-bucket-owner header isn't supported.
IONOS CLOUD Object Storage API requests are authenticated using the AWS signature. The IONOS CLOUD Object Storage API authenticates users using a customized HTTP scheme based on a keyed-HMAC (Hash Message Authentication Code). The process of generating the proper Authorization header is somewhat involved. We recommend that you make use of a tool such as Postman.
In the Authorization tab for a request, select AWS Signature from the Type dropdown list. Specify where Postman should append your authorization data using the Add authorization data to drop-down menu.
-
If you select Request Headers, Postman populates the Headers tab with Authorization and
X-Amz-prefixed fields. -
If you select Request URL, Postman populates the Params tab with authentication details prefixed with
X-Amz-.
Note: The parameters listed below contain confidential information. We recommend using variables to keep this data secure while working in a collaborative environment.
-
For Access Key, enter your
access keydirectly in the fields or through variables for added security. -
For Secret Key, enter your
secret keydirectly in the fields or through variables for added security.
Advanced fields are optional, but Postman will attempt to generate them automatically if necessary.
-
For AWS Region, enter one of the regions (
eu-central-3) where your bucket is hosted. -
For Service Name, enter
s3. The name of the service that receives the requests. -
For Session Token, leave the field blank. This is only required when temporary security credentials are used.
The bucket name.
my-bucketSuccess
DELETE /{Bucket}?cors?cors=true HTTP/1.1
Host: s3.eu-central-3.ionoscloud.com
Authorization: YOUR_API_KEY
Accept: */*
Success
No content
Last updated
Was this helpful?