Download the PHP package rrd108/cakephp-cors without Composer
On this page you can find all versions of the php package rrd108/cakephp-cors. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rrd108/cakephp-cors
More information about rrd108/cakephp-cors
Files in rrd108/cakephp-cors
Package cakephp-cors
Short Description A CakePHP plugin for activate cors domain in your application
License MIT
Informations about the package cakephp-cors
cakephp-cors
A CakePHP 5 plugin for activate cors domain in your application with Middleware.
Forked from ozee31/cakephp-cors as it is archived.
Installation
You can install this plugin into your CakePHP application using composer.
The recommended way to install composer packages is:
Then load the plugin with the command:
Changing the default settings
By default the plugin authorize cors for all origins, all methods and all headers and caches all for one day. If you are happy with the default settings, you can skip this section.
If you want to change any of the values then create your own config/cors.php
file at your project's config
directory. In your config file, you should use only those keys that you want to change. It will be merged to the default one. So, for example, if you are happy with all the options, except AllowOrigin
default, then you have to put this into your on config file.
AllowOrigin (Access-Control-Allow-Origin)
A returned resource may have one Access-Control-Allow-Origin header, with the following syntax:
AllowCredentials (Access-Control-Allow-Credentials)
The Access-Control-Allow-Credentials header Indicates whether or not the response to the request can be exposed when the credentials flag is true. When used as part of a response to a preflight request, this indicates whether or not the actual request can be made using credentials. Note that simple GET requests are not preflighted, and so if a request is made for a resource with credentials, if this header is not returned with the resource, the response is ignored by the browser and not returned to web content.
AllowMethods (Access-Control-Allow-Methods)
AllowHeaders (Access-Control-Allow-Headers)
The Access-Control-Allow-Headers header is used in response to a preflight request to indicate which HTTP headers can be used when making the actual request.
ExposeHeaders (Access-Control-Expose-Headers)
The Access-Control-Expose-Headers header lets a server whitelist headers that browsers are allowed to access. For example:
MaxAge (Access-Control-Max-Age)
The Access-Control-Max-Age header indicates how long the results of a preflight request can be cached. For an example of a preflight request, see the above examples.
All versions of cakephp-cors with dependencies
psr/http-server-handler Version ^1.0
psr/http-server-middleware Version ^1.0