1. Home
  2. Docs
  3. WooCommerce License Keys
  4. API
  5. CORS

CORS

Cross-Origin Resource Sharing (CORS) is a mechanism that uses additional HTTP headers to tell a browser to let a web application running at one origin (domain) have permission to access selected resources from a server at a different origin.

mozilla.org

WooCommerce License Keys allows CORS headers to be modified in order to extend the API’s accessibility.

If clients are having issues connecting to the API, then most likely this is due to CORS configuration.

To change the CORS settings head to “Dashboard” -> “WooCommerce” -> “Settings” -> “Advaced” -> “License Keys API”.

WooCommerce cors settings

Mark the option “Enable override” to enable custom settings and to override WordPress default ones. These will only be effective for the License Keys API requests and will not modify the headers across the WordPress setup.

Best API CORS configuration

The plugin will fill, by default, in the CORS inputs the standard CORS configuration for an API (which are the ones shown in the image above).

Admins are free to change this to meet the desired behavior. This article explains in detail the pros and cons between different CORS configuration and settings.

Was this article helpful to you? Yes No