Get CORS Headers
Retrieves CORS Headers for website acceleration domain.
Request
Request-Line
GET /cdn/v1.0/services/{serviceId}/corsHeaders HTTP/1.1
Request Parameters
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| serviceId | Integer | Mandatory | Service ID. |
Response
Response Body
| Parameter | Type | Description |
|---|---|---|
| accessControlAllowOrigin | String | Specifies which origins can access the response. Must be either *(allow all) or in the format schema://fqdn (e.g., https://www.example.com). null is not allowed. |
| accessControlExposeHeaders | String | Lists the headers that can be exposed to the browser when the requesting code runs in a CORS context. Accepts a comma-separated list of header names (e.g., "Content-Length, X-Request-Id"). |
| accessControlMaxAge | Integer | Maximum time (in seconds) that a CORS preflight response can be cached. Accepts non-negative integers. 0 means no cache. Default is -1 (cache indefinitely). |
| accessControlAllowCredentials | Boolean | The server allows credentials to be included in cross-origin HTTP requests. true is the only valid value for this header and is case-sensitive. If you don't need credentials, omit this header entirely rather than setting its value to false. |
| accessControlAllowMethods | String | HTTP methods allowed for cross-origin requests. Accepts a single method or a comma-separated list. Supported values: GET, POST, PUT, DELETE, HEAD, OPTIONS, CONNECT, TRACE, PATCH. |
| accessControlAllowHeaders | String | HTTP headers that can be used during the actual request. Accepts a comma-separated list of header names (e.g., "Content-type, Authorization"). |
Status Codes, Error Codes and Error Messages
| Status Code | Error Code | Error Message |
|---|---|---|
| 400 | Request.BadRequest | Bad request. |
| 400 | InvalidCustomer.IdEmpty | Customer ID cannot be empty or invalid. |
| 400 | InvalidService.IdIncorrect | Service ID is empty or invalid. |
| 400 | InvalidService.IdPermission | Service ID cannot be found or unknown. |
Examples
Get CORS Headers
Request
GET /cdn/v1.0/services/228654/corsHeaders HTTP/1.1
Successful Response Body
{
"Access-Control-Allow-Methods": "GET,POST,OPTIONS",
"Access-Control-Expose-Headers": "Content-Length, X-Request-Id",
"Access-Control-Allow-Credentials": "true",
"Access-Control-Allow-Headers": "Content-Type, Authorization",
"Access-Control-Allow-Origin": "https://www.example.com",
"Access-Control-Max-Age": 60
}