All Products
Search
Document Center

Object Storage Service:0033-00000003

Last Updated:Apr 29, 2024

Problem description

The value that is specified for the AllowEmptyReferer 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 AllowEmptyReferer parameter in the XML request body is invalid. The value of the AllowEmptyReferer parameter must be of the Boolean type.

Examples

The error is returned because the AllowEmptyReferer parameter in the XML request body is set to 32. The value of the AllowEmptyReferer 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>32</AllowEmptyReferer>
  <AllowTruncateQueryString>false</AllowTruncateQueryString>
  <RefererList>
        <Referer>http://www.aliyun.com</Referer>
  </RefererList>
</RefererConfiguration>

Solutions

Make sure that the value of the AllowEmptyReferer parameter in the XML request body is valid. The parameter specifies whether to allow the requests whose Referer field is empty. Default value: true. Valid values:

  • true: allows requests whose Referer field is empty.

  • false: denies requests whose Referer field is empty.

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>

References