Configuration options
Contents
The following configuration options are available for Guillotine
Config file
To configure Guillotine, add a configuration file to your XP instance’s config folder. This example enables CORS for two frontend origins without cookie credentials. Replace the origins with your frontend addresses, including the scheme and port when applicable.
graphql.extensions.modifyUnknownField=throw
cors.origin=https://example.com, https://admin.example.com
cors.credentials=false
cors.allowedHeaders=Content-Type
cors.methods=POST, OPTIONS
cors.exposedHeaders=X-Request-Id, X-Custom-Header
cors.maxAge=3600
maxQueryTokens=15000
-
graphql.extensions.modifyUnknownField -
Controls attempts to modify an unknown schema field:
throwraises an error,ignoreskips the modification, andwarnlogs a warning. Default isthrow. -
cors.origin -
Allowed origins, comma-separated. Omit this property to disable CORS. Supports
(all origins), literal origins, and~-prefixed regular expressions for dynamic matching.~.reflects any origin. -
cors.credentials -
Sets the
Access-Control-Allow-Credentialsheader. Usetrueorfalse; the default isfalse. For cross-origin cookie authentication, set it totrue, configure explicit allowed origins, and usecredentials: 'include'in the browser’sfetch()request. Browsers do not accept the wildcard origin*with credentials. -
cors.allowedHeaders -
Sets the
Access-Control-Allow-Headersheader. If your client sends anAuthorizationheader, include it, for examplecors.allowedHeaders=Content-Type, Authorization. If this property is omitted, the request’sAccess-Control-Request-Headersvalue is reflected when present. -
cors.methods -
Sets the
Access-Control-Allow-Methodsheader. The Guillotine endpoint answersPOSTandOPTIONSrequests only. The library default isGET, HEAD, POST; the example explicitly allowsPOST, OPTIONS. -
cors.exposedHeaders -
Extra response headers browser scripts may read beyond the CORS safelist. Listing a header does not create it; expose headers your deployment actually returns. Browsers treat
*as a wildcard only for requests without credentials. -
cors.maxAge -
Sets the
Access-Control-Max-Ageheader, specifying the preflight cache duration in seconds. -
maxQueryTokens -
Maximum number of raw query tokens. The parser throws an exception when this limit is exceeded. Default is
15000.
CORS controls which browser origins can read responses. Authentication and content permissions still determine which content the caller can access. See Troubleshooting when requests fail.
Media base URL
When exposing XP’s shared API base URL, GraphQL, images and attachments are reachable under the same public base by default. Clients can use this base, or a separate CDN base, when building media links from path and queryString. Configure the public route to serve those paths.
XP also generates media links inside processed rich text. On XP 8.1 and later, configure their default media base in the XP portal configuration:
media.defaultBaseUrl = https://cdn.example.com/api
This produces media URLs under https://cdn.example.com/api/media:image/…; and https://cdn.example.com/api/media:attachment/…; where a more specific API location or a contextual media mount does not take precedence. Configure the CDN to forward those paths to XP’s corresponding /api/media:image/… and /api/media:attachment/… endpoints. This setting changes URL generation; the CDN route must be configured separately.
Sites that mount the media APIs keep URLs under their own endpoints. To move their media to the default media base, also set legacy.mediaApiAutoMount.enabled = false and omit the relevant media APIs from the site’s descriptor. See the XP media configuration for mount precedence and preview behavior.
Virtual-host context can also declare a shared API location or individual API locations. See the API locations reference for dedicated hosts and paths.