0033-00000009

更新时间:
复制 MD 格式

Problem description

The values of the TruncatePath and AllowTruncateQueryString parameters conflict in the hotlink protection configuration for the bucket.

Causes

You sent a PutBucketReferer request to modify the hotlink protection configuration for a bucket. The request failed because in the request body, the TruncatePath parameter is set to true, but the AllowTruncateQueryString parameter is set to false.

Example problem

The following request fails because the values of TruncatePath and AllowTruncateQueryString conflict in the XML configuration.

PUT /?referer HTTP/1.1
Date: Fri, 24 Feb 2017 03:15:40 GMT
Content-Length: 322
Content-Type: application/xml
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Authorization: OSS qn6q**************:77Dv****************

<?xml version="1.0" encoding="UTF-8"?>
<RefererConfiguration>
	<AllowEmptyReferer>false</AllowEmptyReferer>
  <AllowTruncateQueryString>false</AllowTruncateQueryString>
  <TruncatePath>true</TruncatePath>
  <RefererList>
        <Referer>http://www.aliyun.com</Referer>
  </RefererList>
</RefererConfiguration>

Solutions

If you set the TruncatePath node to true in the XML configuration of the request body, you must also set the AllowTruncateQueryString parameter to true. The following code provides an example of a valid request:

PUT /?referer HTTP/1.1
Date: Fri, 24 Feb 2017 03:15:40 GMT
Content-Length: 322
Content-Type: application/xml
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Authorization: OSS qn6q**************:77Dv****************

<?xml version="1.0" encoding="UTF-8"?>
<RefererConfiguration>
	<AllowEmptyReferer>false</AllowEmptyReferer>
  <AllowTruncateQueryString>true</AllowTruncateQueryString>
  <TruncatePath>true</TruncatePath>
  <RefererList>
        <Referer>http://www.aliyun.com</Referer>
  </RefererList>
</RefererConfiguration>

References