Problem description
The value that is specified for the AllowTruncateQueryString
parameter in the XML request body is invalid.
Causes
You send a PutBucketReferer request to configure hotlink protection. However, the value that is specified for the AllowTruncateQueryString
parameter in the XML request body is invalid. The value of the AllowTruncateQueryString parameter must be of the Boolean type.
Examples
The error is returned because the AllowTruncateQueryString
parameter in the XML request body is set to 32. The value of the AllowTruncateQueryString parameter must be of the Boolean type.
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>32</AllowTruncateQueryString>
<RefererList>
<Referer>http://www.aliyun.com</Referer>
</RefererList>
</RefererConfiguration>
Solutions
Make sure that the value of the AllowTruncateQueryString
parameter in the XML request body is valid. The parameter specifies whether to truncate query strings. Default value: true. Valid values:
true: truncates query strings.
false: does not truncate query strings.
The following sample 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>false</AllowTruncateQueryString>
<RefererList>
<Referer>http://www.aliyun.com</Referer>
</RefererList>
</RefererConfiguration>