Updated on 2022-02-10 GMT+08:00

Bucket CORS Rules

Type Definition

type CorsRule struct

Parameter Description

Field

Type

Optional or Mandatory

Description

ID

string

Optional when used as a request parameter

CORS rule ID. It is a string of 1 to 255 characters.

AllowedMethod

[]string

Mandatory when used as a request parameter

HTTP methods allowed by the CORS rule. Possible values are:

  • GET
  • PUT
  • HEAD
  • POST
  • DELETE

AllowedOrigin

[]string

Mandatory when used as a request parameter

Origins (character strings representing domain names) allowed by the CORS rule. The value can contain one wildcard character (*). Each AllowedOrigin can only contain one or zero wildcard character (*).

AllowedHeader

[]string

Optional when used as a request parameter

Request headers allowed by the CORS rule. The value can contain one wildcard character (*). Each AllowedHeader can only contain one or zero wildcard character (*).

MaxAgeSeconds

int

Optional when used as a request parameter

Cache duration (in seconds) of the cross-region request result in the client allowed by the CORS rule. The value must be an integer.

ExposeHeader

[]string

Optional when used as a request parameter

Additional response headers allowed by the CORS rule. It cannot contain spaces.