This method allow multiple ways to setup the domains, see the examples
### Full URI
cors($request, 'http://www.cakephp.org');
### URI with wildcard
cors($request, 'http://*.cakephp.org');
### Ignoring the requested protocol
cors($request, 'www.cakephp.org');
### Any URI
cors($request, '*');
### Whitelist of URIs
cors($request, ['http://www.cakephp.org', '*.google.com', 'https://myproject.github.io']);
*Note* The $allowedDomains, $allowedMethods, $allowedHeaders parameters are deprecated.
Instead the builder object should be used.
public cors ( Cake\Network\Request $request, string | array $allowedDomains = [], string | array $allowedMethods = [], string | array $allowedHeaders = [] ) : Cake\Network\CorsBuilder | ||
$request | Cake\Network\Request | Request object |
$allowedDomains | string | array | List of allowed domains, see method description for more details |
$allowedMethods | string | array | List of HTTP verbs allowed |
$allowedHeaders | string | array | List of HTTP headers allowed |
return | Cake\Network\CorsBuilder | A builder object the provides a fluent interface for defining additional CORS headers. |