0034-00000002
Updated at:
Problem description
The cross-origin resource sharing (CORS) configuration is missing a rule.
Causes
This error occurs because you called the PutBucketCors operation to configure CORS rules for a bucket, but the submitted XML configuration does not contain a CORS rule.
Examples
For example, you can send the following request:
PUT /?cors HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Content-Length: 186
Date: Fri, 04 May 2012 03:21:12 GMT
Authorization: OSS qn6q**************:77Dv****************
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration>
</CORSConfiguration >
The error occurs because the XML configuration is missing the <CORSRule> tag that defines a CORS rule.
Solutions
When you call the PutBucketCors operation to configure CORS rules for a bucket, make sure that the submitted XML configuration contains at least one CORS rule:
PUT /?cors HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Content-Length: 186
Date: Fri, 04 May 2012 03:21:12 GMT
Authorization: OSS qn6q**************:77Dv****************
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration>
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>PUT</AllowedMethod>
<AllowedMethod>GET</AllowedMethod>
<AllowedHeader>Authorization</AllowedHeader>
</CORSRule>
<ResponseVary>false</ResponseVary>
</CORSConfiguration >
References
Is this page helpful?