You can enable Cross Origin Resource Sharing for data services deployed in WSO2 DSS. As explained below, you have the option of enabling CORS for selected data services or for all the data services.
To enable CORS in DSS:
- Download the following JARs: "cors-filter-2.4.jar" and "java-property-utils-1.9.1.jar".
- Copy the JARs to the
Add the following configurations to the
<filter-mapping>section in the above configuration to specify whether CORS should be enabled for all data services or only selected data services.
To enable CORS for a selected data service, add the service's url as the url pattern:
To enable CORS for multiple data service, you add the urls in a comma separated list:
Alternatively, you can add two separate filter mappings:
Restart the server.