Problem description
The XML body of the PutBucketReferer request is invalid.
Causes
You initiated a PutBucketReferer request to configure hotlink protection for a bucket, but the XML body is invalid or the root node of the XML body is not RefererConfiguration
.
Examples
In the following PutBucketReferer request, the </RefererConfiguration>
closing tag is missing in the XML body. As a result, an error is reported.
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>
Solutions
Add the </RefererConfiguration>
closing tag to the XML body of the PutBucketReferer 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>