Problem description
The request is denied.
Causes
The request header does not contain the Referer field or the Referer field is empty, which does not comply with the hotlink protection configurations of the requested bucket.
Examples
In the following request, the AllowEmptyReferer header in the hotlink protection configurations of the requested bucket is set to false. The value false specifies that requests that contain an empty Referer field are not allowed to access OSS resources.
<RefererConfiguration>
<AllowEmptyReferer>false</AllowEmptyReferer>
<RefererList>
<Referer>*.example.com</Referer>
</RefererList>
</RefererConfiguration>In the following request, the Referer header is not included. As a result, the request fails.
GET /test.txt HTTP/1.1
Date: Tue, 20 Dec 2022 08:48:18 GMT
Host: BucketName.oss-example-endpoint.aliyuncs.comSolutions
To resolve the issue, you can use one of the following methods:
Add the Referer header to the request.
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.comSet the
AllowEmptyRefererheader in the hotlink protection configurations of the requested bucket to true.<RefererConfiguration> <AllowEmptyReferer>true</AllowEmptyReferer> </RefererConfiguration>