0033-00000008

更新时间:
复制 MD 格式

Problem description

The value of the TruncatePath parameter in the bucket's hotlink protection configuration is invalid.

Cause

You sent a PutBucketReferer request to modify the hotlink protection configuration of a bucket. However, the value of the TruncatePath parameter in the request body is not a valid Boolean value. This results in an API error.

Sample problems

In the following sample request, the value of the TruncatePath parameter in the XML configuration is 32. This value is invalid and causes the request to fail.

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>32</TruncatePath>
  <RefererList>
        <Referer>http://www.aliyun.com</Referer>
  </RefererList>
</RefererConfiguration>

Solution

Ensure that the value of the TruncatePath node in the XML configuration of the request body is valid. This node specifies whether to truncate the path. Valid values are:

  • true: Truncates the path component of the URL in the Referer header.

  • false (default): Does not truncate the path component of the URL in the Referer header.

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