Problem description
The request is denied.
Causes
The request has no Referer header, or the Referer header is present but contains no value. Either case is considered an empty Referer.
The bucket's hotlink protection configuration has AllowEmptyReferer set to false, which blocks any request with an empty Referer.
Examples
The following hotlink protection configuration blocks requests with an empty Referer:
<RefererConfiguration>
<AllowEmptyReferer>false</AllowEmptyReferer>
<RefererList>
<Referer>*.example.com</Referer>
</RefererList>
</RefererConfiguration>The following request omits the Referer header and is therefore denied:
GET /test.txt HTTP/1.1
Date: Tue, 20 Dec 2022 08:48:18 GMT
Host: BucketName.oss-example-endpoint.aliyuncs.comSolutions
Use one of the following approaches to resolve the issue.
Option 1: Add the Referer header to the request
Include a Referer header whose value matches one of the patterns in the bucket's RefererList:
GET /test.txt HTTP/1.1
Date: Tue, 20 Dec 2022 08:48:18 GMT
Host: BucketName.oss-example-endpoint.aliyuncs.com
Referer: https://help.example.comOption 2: Allow empty Referer values in the bucket configuration
Set AllowEmptyReferer to true in the bucket's hotlink protection configuration:
<RefererConfiguration>
<AllowEmptyReferer>true</AllowEmptyReferer>
</RefererConfiguration>