CORS Policy
Last updated
Last updated
Cross-Origin Resource Sharing (CORS) is an HTTP-header based mechanism that allows a server to indicate any origins (domain, scheme, or port) other than its own from which a browser should permit loading of resources. For more information, see the Mozilla CORS article.
Browser security prevents a web page from making requests to a different domain than the one that served the web page. This restriction applies to UbiFunctions to prevent any malicious site from reading sensitive data. Sometimes, you might want to allow other sites to make cross-origin requests to your UbiFunctions.
To enable the CORS policies to an UbiFunction, allowing it to be called from web browsers or HTML canvas widget, please follow the steps below:
Step 1: Go to Device tab of your Ubidots header and select Functions.
Step 2: Enter to an existing UbiFunction or create one.
Step 3: Toggle the option CORS policy in the settings section of the UbiFunction.
Step 4: Save by clicking on the Save button.