To Set CORS Validation in a Flow
-
Drag and drop a CORS Validate component from the Mule Palette into your canvas.
-
Click the newly added CORS Validate component to access the component’s Mule Properties view.
-
Click the Add button in the CORS Configuration section () to create a new CORS Validate global configuration.
-
Add your selected origin domain by clicking the Add button in the Origin section of the Origins Configuration. For each origin domain that you add, you can configure the allowed methods, response headers, and the headers to expose as part of the CORS response. You can also set the value for the Access-Control-Max-Age header.
-
Click OK.
Additionally, you can select the Public Resource and Accepts Credentials options in the CORS validate component Mule Properties view:
-
The Public Resource option sets the rest of the flow as publicly accessible disregarding of the origin of the request.
-
The Accepts Credentials option lets you configure whether the rest of the flow accepts credentials or not.