{"version": "2.0","statement": [{"action": ["name/cos:GetBucketCORS"],"effect": "allow","resource": ["qcs::cos:ap-beijing:uid/1250000000:examplebucket-1250000000/*"]}]}
GET /?cors HTTP/1.1Host: <BucketName-APPID>.cos.<Region>.myqcloud.comDate: GMT DateAuthorization: Auth String
<?xml version='1.0' encoding='utf-8' ?><CORSConfiguration><CORSRule><AllowedOrigin>string</AllowedOrigin><AllowedMethod>enum</AllowedMethod><AllowedMethod>enum</AllowedMethod><AllowedHeader>string</AllowedHeader><AllowedHeader>string</AllowedHeader><ExposeHeader>string</ExposeHeader><ExposeHeader>string</ExposeHeader><MaxAgeSeconds>integer</MaxAgeSeconds></CORSRule><CORSRule><ID>string</ID><AllowedOrigin>string</AllowedOrigin><AllowedOrigin>string</AllowedOrigin><AllowedMethod>enum</AllowedMethod><AllowedMethod>enum</AllowedMethod><AllowedHeader>string</AllowedHeader><ExposeHeader>string</ExposeHeader><ExposeHeader>string</ExposeHeader><MaxAgeSeconds>integer</MaxAgeSeconds></CORSRule><ResponseVary>false</ResponseVary></CORSConfiguration>
Node Name (Keyword) | Parent Node | Description | Type |
CORSConfiguration | None | Save all information from the GET Bucket cors result. | Container |
Node Name (Keyword) | Parent Node | Description | Type |
CORSRule | CORSConfiguration | Describes all information of a single Cross-Origin Resource Sharing (CORS) configuration. | Container |
ResponseVary | CORSConfiguration | Indicates whether the cross-origin request returns the Vary:Origin header. Supports the Boolean value true|false, where true means it is returned, and false means it is not returned. | Boolean |
Node Name (Keyword) | Parent Node | Description | Type |
AllowedOrigin | CORSConfiguration.CORSRule | Allowed origins can be * or a wildcard format containing *. Multiple AllowedOrigin entries can be configured in a single CORSRule. | string |
AllowedMethod | CORSConfiguration.CORSRule | Allowed HTTP operation methods (Method), which correspond to the Access-Control-Allow-Methods header in the CORS request response. Multiple AllowedMethod entries can be configured in a single CORSRule. Enumerated values: PUT, GET, POST, DELETE, HEAD | enum |
AllowedHeader | CORSConfiguration.CORSRule | Custom HTTP request headers that are allowed to be carried when a browser sends a CORS request. These headers are case-insensitive and can be *. Multiple AllowedHeader entries can be configured in a single CORSRule. | string |
ExposeHeader | CORSConfiguration.CORSRule | Headers in the CORS request response that are allowed to be obtained by the browser. These headers are case-insensitive. Multiple ExposeHeader entries can be configured in a single CORSRule. | string |
MaxAgeSeconds | CORSConfiguration.CORSRule | The validity period of the Cross-Origin Resource Sharing configuration, measured in seconds, corresponds to the Access-Control-Max-Age header in the CORS request response. Only one MaxAgeSeconds can be configured for a single CORSRule. | integer |
ID | CORSConfiguration.CORSRule | The ID configured for a single CORSRule. The existence of this node depends on whether an ID was specified when the PUT Bucket cors request is used to set the bucket's Cross-Origin Resource Sharing configuration. A single CORSRule can be configured with at most one ID. | string |
GET /?cors HTTP/1.1Host: examplebucket-1250000000.cos.ap-beijing.myqcloud.comDate: Thu, 09 Jul 2020 11:15:12 GMTAuthorization: q-sign-algorithm=sha1&q-ak=************************************&q-sign-time=1594293312;1594300512&q-key-time=1594293312;1594300512&q-header-list=date;host&q-url-param-list=cors&q-signature=****************************************Connection: close
HTTP/1.1 200 OKContent-Type: application/xmlContent-Length: 1196Connection: closeDate: Thu, 09 Jul 2020 11:15:12 GMTServer: tencent-cosx-cos-request-id: NWYwNmZjNDBfN2ViMTJhMDlfZDNjOV8xYjdk****<?xml version='1.0' encoding='utf-8' ?><CORSConfiguration><CORSRule><AllowedOrigin>*</AllowedOrigin><AllowedMethod>GET</AllowedMethod><AllowedMethod>HEAD</AllowedMethod><AllowedHeader>Range</AllowedHeader><AllowedHeader>x-cos-server-side-encryption-customer-algorithm</AllowedHeader><AllowedHeader>x-cos-server-side-encryption-customer-key</AllowedHeader><AllowedHeader>x-cos-server-side-encryption-customer-key-MD5</AllowedHeader><ExposeHeader>Content-Length</ExposeHeader><ExposeHeader>ETag</ExposeHeader><ExposeHeader>x-cos-meta-author</ExposeHeader><MaxAgeSeconds>600</MaxAgeSeconds></CORSRule><CORSRule><ID>example-id</ID><AllowedOrigin>https://example.com</AllowedOrigin><AllowedOrigin>https://example-1.com</AllowedOrigin><AllowedMethod>PUT</AllowedMethod><AllowedMethod>GET</AllowedMethod>...<AllowedMethod>HEAD</AllowedMethod><AllowedHeader>*</AllowedHeader><ExposeHeader>Content-Length</ExposeHeader><ExposeHeader>ETag</ExposeHeader><ExposeHeader>x-cos-meta-author</ExposeHeader><MaxAgeSeconds>600</MaxAgeSeconds></CORSRule></CORSConfiguration>
Esta página foi útil?
Você também pode entrar em contato com a Equipe de vendas ou Enviar um tíquete em caso de ajuda.
comentários