• Object Storage Service

obs
  1. Help Center
  2. Object Storage Service
  3. API Reference (OBS)
  4. Operations on Buckets
  5. GET Bucket CORS
  6. Responses

Responses

Syntax

HTTP/1.1 status_code
 Server: Server Name 
 x-amz-request-id: id 
 x-amz-id-2: id 
 x-reserved: reserved info 
 Content-Type: type 
 Date: date 
 Content-Length: lenth 

 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
 <CORSConfiguration xmlns="http://obs.example.com/doc/2015-06-30/"> 
   <CORSRule> 
     ... 
   </CORSRule> 
 </CORSConfiguration>

Response Headers

This response uses common headers. For details about common response headers, see section Common Response Headers.

Response Elements

This response contains elements to detail the CORS configuration. Table 1 describes the elements.

Table 1 CORS configuration elements

Element

Description

CORSConfiguration

Indicates the CORSRules root node. The maximum size is 64 KB.

Type: Container

Ancestor: None

CORSRule

Indicates a CORS rule. CORSConfiguration can contain a maximum of 100 rules.

Type: Container

Ancestor: CORSConfiguration

ID

Indicates the unique identifier of a rule. The value can contain a maximum of 255 characters.

Type: String

Ancestor: Rule

AllowedMethod

Indicates a method that is allowed by a CORS rule.

Type: String

Valid values: GETPUTHEADPOST, and DELETE

Ancestor: Rule

AllowedOrigin

Indicates an origin that is allowed by a CORS rule. It is a character string and can contain a wildcard (*). Each AllowedOrigin can only contain one wildcard (*).

Type: String

Ancestor: Rule

AllowedHeader

Indicates an allowed header (Access-Control-Request-Headers) in a CORS request. If a request contains Access-Control-Request-Headers, only a CORS request that matches the configuration of AllowedHeader is considered as a valid request. Each AllowedHeader can only contain one wildcard (*).

Type: String

Ancestor: Rule

MaxAgeSeconds

Indicates the response time of the CORS that can be cached by a server. It is expressed in seconds.

Each CORSRule can contain only one MaxAgeSeconds. It can be set to a negative value.

Type: Integer

Ancestor: Rule

ExposeHeader

Indicates a supplemented header in CORS responses. The header provides additional information for servers. It cannot contain spaces.

Type: String

Ancestor: Rule

Error Responses

For details about other error responses, see Table 1. In addition, this response contains one special error, as described in Table 2.

Table 2 Special error

Error Code

Description

HTTP Status Code

NoSuchCORSConfiguration

Indicates that the CORS configuration of buckets does not exist.

404 Not Found