Skip to main content

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

ParameterTypeRequiredDescription
serviceIdIntegerMandatoryService ID.

Response

Response Body

ParameterTypeDescription
accessControlAllowOriginStringSpecifies 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.
accessControlExposeHeadersStringLists 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").
accessControlMaxAgeIntegerMaximum time (in seconds) that a CORS preflight response can be cached. Accepts non-negative integers. 0 means no cache. Default is -1 (cache indefinitely).
accessControlAllowCredentialsBooleanThe 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.
accessControlAllowMethodsStringHTTP 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.
accessControlAllowHeadersStringHTTP 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 CodeError CodeError Message
400Request.BadRequestBad request.
400InvalidCustomer.IdEmptyCustomer ID cannot be empty or invalid.
400InvalidService.IdIncorrectService ID is empty or invalid.
400InvalidService.IdPermissionService 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
}