Skip to main content
Content Starts Here Search Solutions

Solution Detail

 
Solution TitleIs Cross-Origin Resource Sharing ( CORS ) supported by Switch Web Portal?
Solution Number00000832
Solution Details
Background
Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources on a web page to be requested from another domain outside the domain from which the first resource was served.

Solution
CORS is supported by the web portal or/and web services. There are 2 different servers that can be used in the Switch Web Portal, HTTP and HTTPS. 
Note that if you try to do CORS requests from a HTTPS domain to HTTP, you will also need to add the HTTPS preferences in your Switch preferences.
How to set up HTTPS can be found here: link

Information
The CORS headers are configured as below on server side:

res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept, Authorization');
res.header('Access-Control-Allow-Methods', 'PUT, GET, POST, DELETE, OPTIONS');

 
Does this solution help you answer your question?