Skip to main content
Version: 11.0

Server configuration: Cors element

In a config.xmlserver configuration file, the <Cors> element contains configuration properties for CORS configurations. This element has <CorsConfig> and <Rule> child elements.

Example

<Cors>
  <CorsConfig name="Default">
     <Rule
Access-Control-Allow-Origin="*"
Access-Control-Allow-Methods="GET, POST, PUT, DELETE"
Access-Control-Allow-Headers="Content-Type,Authorization,Accept,X-US-Transaction"
Access-Control-Allow-Credentials="true"/>
  </CorsConfig>
</Cors>

Cors element

Child elements

The following table describes child elements for the <Cors> element:

NameRequiredDescription
CorsConfigNo Contains a collection of rules describing a CORS configuration.

Attributes

none

CorsConfig element

Child elements

The following table describes child elements for the <CorsConfig> element:

NameRequiredDescription
RuleNo A rule used for CORS.

Attributes

none

Rule

Child elements

none

Attributes

The following table describes attributes for the <Rule> element:

NameRequiredTypeDescription
Access-Control-Allow-OriginNo StringIndicates which origin sites may access the resource.
Access-Control-Allow-MethodsNo StringSpecifies the methods allowed when accessing the resources.
Access-Control-Allow-HeadersNo StringSpecifies the headers allowed to be used in the request.
Access-Control-Expose-HeadersNo StringIndicates which headers can be exposed as part of the response
Access-Control-Max-AgeNo IntegerIndicates how long the results of a preflight request can be cached (-1 if disabled).
Access-Control-Allow-CredentialsNo true/false valueIndicates whether or not the response to the request can be exposed when the credentials flag is true.