Updated on 2026-08-03 GMT+08:00

obs_bucket_cors_conf

Table 1 obs_bucket_cors_conf

Parameter

Type

Mandatory (Yes/No)

Description

id

const char *

No

Explanation:

The ID of a CORS rule.

Restrictions:

None

Value range:

A string of 1 to 255 characters.

Default value:

None

allowed_method

const char **

Yes

Explanation:

The allowed HTTP methods (types of operations on buckets and objects) for a cross-origin request.

Restrictions:

None

Value range:

The following HTTP methods are supported:

  • GET
  • PUT
  • HEAD
  • POST
  • DELETE

Default value:

None

allowed_method_number

unsigned int

No

Explanation:

Number of the allowed_method elements.

Restrictions:

None

Value range:

None

Default value:

None

allowed_origin

const char **

No

Explanation:

The origin that is allowed to access the bucket.

Restrictions:

Only English domain names are supported. Regular expressions are used to match. Each rule allows at most one asterisk (*). For example, https://*.vbs.example.com.

Value range:

The value must comply with the CORS protocol and contain 0 to 20480 characters.

Default value:

None

allowed_origin_number

unsigned int

No

Explanation:

Number of the allowed_origin elements.

Restrictions:

None

Value range:

None

Default value:

None

allowed_header

const char **

No

Explanation:

The allowed headers for Access-Control-Request-Headers in a CORS configuration request. If a CORS request contains Access-Control-Request-Headers, this request is considered valid only when it matches the configuration of allowed_header. The matching is based on regular expressions.

Restrictions:

At most one asterisk (*) is allowed. Spaces, ampersands (&), colons (:), less-than signs (<), and full-width characters are not allowed.

Value range:

The value must comply with the CORS protocol and contain 0 to 20480 characters.

Default value:

None

allowed_header_number

unsigned int

No

Explanation:

Number of the allowed_header elements.

Restrictions:

None

Value range:

None

Default value:

None

max_age_seconds

const char *

No

Explanation:

How long the response can be cached on a client.

Restrictions:

Each CORS rule can contain at most one max_age_seconds.

Value range:

An integer greater than or equal to 0, in seconds.

Default value:

3000

expose_header

const char **

No

Explanation:

It specifies additional headers a CORS rule allows in a response, which can be used to provide extra information to clients. By default, a browser can access only headers Content-Length and Content-Type. If the browser needs to access other headers, you need to configure them as additional headers.

Restrictions:

Spaces, asterisks (*), ampersands (&), colons (:), less-than signs (<), and full-width characters are not allowed.

Value range:

The value that complies with the CORS

Default value:

None

expose_header_number

unsigned int

No

Explanation:

Number of the expose_header elements.

Restrictions:

None

Value range:

None

Default value:

None