PUT Bucket referer

Last updated: 2020-02-28 18:20:14

PDF

Description

This API (GET Bucket Referer) is used to read the whitelist or the blacklist of Bucket Referer.

Request

Request Sample

GET /?referer HTTP 1.1
Host:<BucketName-APPID>.<Region>.myqcloud.com
Date: GMT Date
Authorization: Auth String

Note:

Authorization:Auth String (see Request Signature Documentation).

Request header

This API only uses common request headers. For more information, please see Common Request Headers Document.

Request body

The request body of this request is empty.

Response

Response header

This API only returns the public response header. For more information, please see Common Response Header Document.

Response body

Application/xml data is returned in the response body. It contains the complete node data, as shown below:

<RefererConfiguration>
    <Status>Enabled</Status>
    <RefererType>White-List</RefererType>
    <DomainList>
        <Domain>*.qq.com</Domain>
        <Domain>*.qcloud.com</Domain>
    </DomainList>
    <EmptyReferConfiguration>Allow</EmptyReferConfiguration>
</RefererConfiguration>

Please find the details below:

Name Parent node Description Type Required
RefererConfiguration None Hotlink protection Prevent hotlinking configuration Information Container Yes
Status RefererConfiguration Whether to enable Hotlink protection Prevent hotlinking. Enumerated values: Eabled,Disabled String Yes
RefererType RefererConfiguration Hotlink protection Prevent hotlinking type. Enumerated value: Black-List,White-List String Yes
DomainList RefererConfiguration List of valid domain names. Multiple domain names with prefixes are supported, domain names with ports are supported, and IP, supports wildcards. * Wildcard, who is a second-level domain name or a multi-level domain name Container Yes
Domain DomainList A single effective domain name, such as www.qq.com/example , 192.168.1.2:8080 , *.qq.com String Yes
EmptyReferConfiguration RefererConfiguration Whether to allow empty Referer Access. Enumerated values: Allow,Deny, default is Deny. String No

Error Codes

There is no special error message for this request operation. For all error messages, see Error Codes Document.

Actual case

Request

GET /?referer HTTP 1.1
Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.com
Date: Fri, 25 Feb 2017 04:10:22 GMT
Authorization:q-sign-algorithm=sha1&q-ak=AKIDZfbOAo7cllgPvF9cXFrJD0a1ICvR****&q-sign-time=1547105134;32526689134&q-key-time=1547105134;32620001134&q-header-list=content-md5;content-type;host&q-url-param-list=referer&q-signature=0f7fef5b1d2180deaf6f92fa2ee0cf87ae83****

Response

HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 260
Connection: keep-alive
Date: Fri, 25 Feb 2017 04:10:22 GMT
Server: tencent-cos
x-cos-request-id: NTg3ZjFjMmJfOWIxZjRlXzZmNDhf****

<RefererConfiguration>
    <Status>Enabled</Status>
    <RefererType>White-List</RefererType>
    <DomainList>
        <Domain>*.qq.com</Domain>
        <Domain>*.qcloud.com</Domain>
    </DomainList>
    <EmptyReferConfiguration>Allow</EmptyReferConfiguration>
</RefererConfiguration>