Get Bucket Referer

Last Updated: Mar 20, 2017

The Get Bucket Referer operation is used to view the referer configuration of a bucket. For details about bucket referer, see OSS Anti-Leech.

Request syntax

  1. GET /?referer HTTP/1.1
  2. Host: BucketName.oss.aliyuncs.com
  3. Date: GMT Date
  4. Authorization: SignatureValue

Response elements

Name Description
RefererConfiguration The container that saves the Referer configuration content
Type: container
Sub-nodes: AllowEmptyReferer node and RefererList node
Parent node: none
AllowEmptyReferer Specify whether the access request with the referer field being null is allowed.
Type: enumerative string Valid value: true or false `Default value: true
Parent node: RefererConfiguration
RefererList The container that saves the referer access white list.
Type: container
Parent node: RefererConfiguration
Sub-node: Referer
RefererList Specify a referer access white list.
Type: string
Parent node: RefererList

Detail analysis

  1. If the bucket does not exist, error 404 is returned. Error code: NoSuchBucket.
  2. Only the owner of a bucket can view the referer configuration of the bucket. If other users attempt to access the configuration, the error 403 Forbidden with the error code: AccessDenied will be returned.
  3. If no referer configuration has been conducted for the bucket, the OSS returns the default AllowEmptyReferer value and an empty RefererList.

Example

Request example:

  1. Get /?referer HTTP/1.1
  2. Host: oss-example.oss.aliyuncs.com
  3. Date: Thu, 13 Sep 2012 07:51:28 GMT
  4. Authorization: OSS qn6qrrqxo2oawuk53otfjbyc: BuG4rRK+zNhH1AcF51NNHD39zXw=

Response example with a referer rule configured for the bucket:

  1. HTTP/1.1 200
  2. x-oss-request-id: 534B371674E88A4D8906008B
  3. Date: Thu, 13 Sep 2012 07:51:28 GMT
  4. Connection: keep-alive
  5. Content-Length: 218
  6. Server: AliyunOSS
  7. <?xml version="1.0" encoding="UTF-8"?>
  8. <RefererConfiguration>
  9. <AllowEmptyReferer>true</AllowEmptyReferer >
  10. <RefererList>
  11. <Referer> http://www.aliyun.com</Referer>
  12. <Referer> https://www.aliyun.com</Referer>
  13. <Referer> http://www.*.com</Referer>
  14. <Referer> https://www.?.aliyuncs.com</Referer>
  15. </RefererList>
  16. </RefererConfiguration>

Response example with no referer rule configured for the bucket:

  1. HTTP/1.1 200
  2. x-oss-request-id: 534B371674E88A4D8906008B
  3. Date: Thu, 13 Sep 2012 07:56:46 GMT
  4. Connection: keep-alive
  5. Content-Length: 308
  6. Server: AliyunOSS
  7. <?xml version="1.0" encoding="UTF-8"?>
  8. <RefererConfiguration>
  9. <AllowEmptyReferer>true</AllowEmptyReferer >
  10. < RefererList />
  11. </RefererConfiguration>
Thank you! We've received your feedback.