CORS
section is added to an API definition as listed in the examples below for Tyk Gateway and Tyk Operator.
CORS.allowed_origins
: A list of origin domains to allow access from. Wildcards are also supported, e.g. http://*.foo.com
. Default value is ["*"]
CORS.allowed_methods
: A list of methods to allow access via. Default value is ["GET", "POST", "HEAD"]
CORS.allowed_headers
: A list of headers that are allowed within a request. Default value is ["Origin", "Accept", "Content-Type", "X-Requested-With"]
CORS.exposed_headers
: A list of headers that are exposed back in the response.
CORS.allow_credentials
: Whether credentials (cookies) should be allowed.
CORS.max_age
: Maximum age of credentials.
CORS.options_passthrough
: allow CORS OPTIONS preflight request to be proxied directly to upstream, without authentication and rest of checks. This means that pre-flight requests generated by web-clients such as SwaggerUI or
the Tyk Portal documentation system will be able to test the API using trial keys. If your service handles CORS natively, then enable this option.
debug
: If set to true
, this option produces log files for the CORS middleware.