Queries the Referer configurations of a bucket.

Request syntax

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

Response elements

Element Type Description
RefererConfiguration Container The container that contains the Referer configurations.

Parent nodes: none

Child nodes: AllowEmptyReferer, AllowTruncateQueryString, and RefererList

AllowEmptyReferer Enumerated string Indicates whether empty Referer fields are allowed in requests.

Parent nodes: RefererConfiguration

AllowTruncateQueryString Enumerated string Indicates whether query strings are truncated.

Parent nodes: RefererConfiguration

RefererList Container The container that contains the Referer whitelist.

Parent nodes: RefererConfiguration

Child nodes: Referer

Referer String The specified Referer whitelist.

Parent nodes: RefererList

Examples

Sample requests

Get /?referer HTTP/1.1
Host: oss-example.oss.aliyuncs.com  
Date: Thu, 13 Sep 2012 07:51:28 GMT
Authorization: OSS qn6qrrqxo2oawuk53otf****: BuG4rRK+zNhH1AcF51NNHD39****
Sample responses
  • Sample responses to requests that include the Referer elements
    HTTP/1.1 200
    x-oss-request-id: 534B371674E88A4D8906****
    Date: Thu, 13 Sep 2012 07:51:28 GMT
    Connection: keep-alive
    Content-Length: 218  
    Server: AliyunOSS
    <?xml version="1.0" encoding="UTF-8"?>
    <RefererConfiguration>
    <AllowEmptyReferer>true</AllowEmptyReferer>
    <AllowTruncateQueryString>false</AllowTruncateQueryString>
        <RefererList>
            <Referer> http://www.aliyun.com</Referer>
            <Referer> https://www.aliyun.com</Referer>
            <Referer> http://www.*.com</Referer>
            <Referer> https://www.?.aliyuncs.com</Referer>
        </RefererList>
    </RefererConfiguration>
  • Sample responses to requests that exclude the Referer elements
    Note If the bucket has no Referer-related configurations, OSS returns the default AllowEmptyReferer value and an empty RefererList.
    HTTP/1.1 200
    x-oss-request-id: 534B371674E88A4D8906****
    Date: Thu, 13 Sep 2012 07:56:46 GMT
    Connection: keep-alive
    Content-Length: 308  
    Server: AliyunOSS
    <?xml version="1.0" encoding="UTF-8"?>
    <RefererConfiguration>
    <AllowEmptyReferer>true</AllowEmptyReferer>
    < RefererList />
    </RefererConfiguration>

SDK

You can use OSS SDKs for the following programming languages to call GetBucketReferer:

Error codes

Error code HTTP status code Description
NoSuchBucket 404 The error message returned because the destination bucket does not exist.
AccessDenied 403 The error message returned because you are not authorized to query the Referer configurations of the bucket. Only the bucket owner can query the Referer configurations of the bucket.