Nav

CORS Validate Component Reference

Namespace and Schema

XML Namespace

xmlns:cors="http://www.mulesoft.org/schema/mule/cors"

XML Schema Location

http://www.mulesoft.org/schema/mule/cors http://www.mulesoft.org/schema/mule/cors/current/mule-cors.xsd

CORS Validate Global Configuration

Global Configuration Syntax


          
       
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<cors:config name="corsConfig">
  <cors:origins>
      <cors:origin url="domain-a.com" accessControlMaxAge="30">

          <cors:methods>
              <cors:method>GET</cors:method>
              <cors:method>POST</cors:method>
              <cors:method>OPTIONS</cors:method>
          </cors:methods>

          <cors:headers>
              <cors:header>X-Allow-Origin</cors:header>
          </cors:headers>

      </cors:origin>
  </cors:origins>
</cors:config>

Global Configuration Elements

cors:config

Table 1. Attributes
Name Description

name

Give a name to this configuration so it can be later referenced by config-ref.

Data Type: String

storePrefix

Prefix used to differentiate the object store used as the backend of the configured origins.

Data Type: String

originsStore-ref

The object store used for storing the origins.

Data Type: String

Child cors-config Element

Origins

No Attributes

Child Origins Element

origin

Table 2. Attributes
Name Description

url

The url to whitelist as an origin

Data Type: String

accessControlMaxAge

Value to set the Access-Control-Max-Age header

Data Type: longType

CORS Validate Component

Validate Element Syntax


          
       
1
2
3
<cors:validate config-ref="corsConfig"
               publicResource="false"
               acceptsCredentials="false"/>

Validate Elements

validate

Table 3. Attributes
Name Description

config-ref

Specify which configuration to use for this invocation.

Data Type: String

publicResource

Specifies if this resource should be publicly available regardless the origin.

Data Type: booleanType Default Value: false

acceptsCredentials

specifies whether the resource accepts credentials or not.

Data Type: booleanType Default Value: false