0034-00000005

更新时间:
复制 MD 格式

Problem description

The CORSRule child node in the cross-origin resource sharing (CORS) XML configuration has an invalid format.

Causes

You called the PutBucketCors operation to configure CORS rules for a bucket. However, the CORSRule child node in the submitted XML configuration has an invalid format.

Example problem

For example, you initiate 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>
    <CORSRule>
      <AllowedOrigin>*</AllowedOrigin>
      <AllowedMethod>PUT</AllowedMethod>
      <AllowedMethod>GET</AllowedMethod>
      <AllowedHeader>Authorization
    </CORSRule>
    <ResponseVary>false</ResponseVary>
</CORSConfiguration>

This error occurs because the AllowedHeader child node within the CORSRule node is missing a closing tag. As a result, the XML structure is invalid.

Solution

Make sure that the XML configuration in the PutBucketCors request is valid.

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