Cross-Origin Resource Sharing (CORS) is a series of security policies to avoid a web browser fetching resources from a different domain. By default, CORS will block any request that a website makes to a different domain.
However, servers can set the CORS HTTP headers to indicate the browser they are fine to process the request. CORS can be configured using several headers. Some of them provides a global policy while others helps to add granularity to the requests:
Access-Control-Allow-Origin: http://example.com
Access-Control-Allow-Methods: POST, GET, OPTIONS
Access-Control-Allow-Headers: Content-Type
Access-Control-Max-Age: 10000
I recommend you to check the Cross-Origin Resource Sharing (CORS) documentation about the different headers and behaviors.
On wws, we plan to provide two different approaches to set the CORS policy:
- With a global
--cors option. This option will configure the Access-Control-Allow-Origin header. It will be applied to all requests
- Every worker can set its own headers. In this way, we allow workers to customize the response. This approach has preference to the
--cors option. If both are set, the worker value will be sent
Cross-Origin Resource Sharing (CORS) is a series of security policies to avoid a web browser fetching resources from a different domain. By default, CORS will block any request that a website makes to a different domain.
However, servers can set the CORS HTTP headers to indicate the browser they are fine to process the request. CORS can be configured using several headers. Some of them provides a global policy while others helps to add granularity to the requests:
Access-Control-Allow-Origin: http://example.comAccess-Control-Allow-Methods: POST, GET, OPTIONSAccess-Control-Allow-Headers: Content-TypeAccess-Control-Max-Age: 10000I recommend you to check the Cross-Origin Resource Sharing (CORS) documentation about the different headers and behaviors.
On
wws, we plan to provide two different approaches to set theCORSpolicy:--corsoption. This option will configure theAccess-Control-Allow-Originheader. It will be applied to all requests--corsoption. If both are set, the worker value will be sent