You need to enable JavaScript to run this app.
Torch Object Storage

Torch Object Storage

Copy page
Download PDF
Bucket CORS
GetBucketCORS
Copy page
Download PDF
GetBucketCORS
Feature description​
This interface retrieves the current Cross-Origin Resource Sharing (CORS) configuration rules of the specified bucket.​
warning​
Your account must have tos:GetBucketCORS permission to obtain the bucket’s CORS rules. For details, see the Permission Configuration Guide.​
Request syntax​
​
GET /?cors HTTP/1.1​
Host: bucketname.tos-cn-beijing.volces.com​
Date: Fri, 30 Jul 2021 08:05:36 +0000​
Authorization: authorization string​
​
Request parameters and headers​
This request uses common request headers; refer to Common Parameters.​
​
Name​
Location​
Type​
Required​
Sample Value​
Description​
cors​
Query​
String​
Yes​
-​
Identifies a GetBucketCORS request.​
​
Request body elements​
No elements are used.​
Response headers​
This request returns public response headers. See Public parameters.​
Response body elements​
The response contains the complete set of CORS rules of the bucket.​
​
Name​
Type​
Sample Value​
Note​
CORSRules​
Array​
-​
The CORS rule information.​
AllowedOrigins​
Array​
["*"]​
Specifies the allowed origins of cross-origin requests.​
AllowedMethods​
Array​
["PUT", "GET"]​
Specifies the allowed cross-origin request methods.​
AllowedHeaders​
Array​
["Authorization"]​
Specifies the allowed headers.​
ExposeHeaders​
Array​
["x-tos-test"]​
Specifies the allowed response headers.​
MaxAgeSeconds​
Integer​
1024​
The maximum cache time.​
ResponseVary​
Bool​
false​
Whether to return the Vary: Origin header.​
​
Sample request​
​
GET /?cors HTTP/1.1​
Host: bucketname.tos-cn-beijing.volces.com​
Date: Fri, 30 Jul 2021 13:53:55 +0000​
Authorization: authorization string​
​
Sample response​
​
HTTP/1.1 200 OK​
Date: Fri, 30 Jul 2021 13:53:55 GMT​
Server: TosServer​
x-tos-id-2: 1e89f203jld00006-a444fd0​
x-tos-request-id: 1e89f203b2d00006-a444ed0​
Content-Length: 643​
​
{​
"CORSRules":[​
{​
"AllowedOrigins":["http://www.example.com"],​
"AllowedMethods":["PUT", "GET"],​
"AllowedHeaders":["*"],​
"ExposeHeaders":["x-tos-test"],​
"MaxAgeSeconds":1024,​
"ResponseVary" : false​
}​
]​
}​
​
​
Last updated: 2026.02.10 15:12:57