Download the PHP package mehmetik/cors without Composer
On this page you can find all versions of the php package mehmetik/cors. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mehmetik/cors
More information about mehmetik/cors
Files in mehmetik/cors
Package cors
Short Description The `CorsSupport` class is a library for managing cross-origin resource sharing (CORS) and a middleware that operates on HTTP requests and responses in a stack application.
License MIT
Homepage https://github.com/mehmetik/cors
Informations about the package cors
mehmetik/cors
This package provides a library and stack middleware for handling Cross-Origin Resource Sharing (CORS) in a Stack application.
Installation
To install the package, require it through Composer.
Usage
This package can be used as a library or as stack middleware.
Options
Option | Description | Type | Default value |
---|---|---|---|
allowedMethods | Matches the request method. | string[] |
[] |
allowedOrigins | Matches the request origin. | string[] |
[] |
allowedOriginsPatterns | Matches the request origin with preg_match . |
string[] |
[] |
allowedHeaders | Sets the Access-Control-Allow-Headers response header. | string[] |
[] |
exposedHeaders | Sets the Access-Control-Expose-Headers response header. | string[] |
[] |
maxAge | Sets the Access-Control-Max-Age response header. | int |
false |
supportsCredentials | Sets the Access-Control-Allow-Credentials header. | bool |
false |
The allowedMethods and allowedHeaders options are case-insensitive.
You don't need to provide both allowedOrigins and allowedOriginsPatterns. If one of the strings passed matches, it is considered a valid origin.
If ['*']
is provided to allowedMethods, allowedOrigins or allowedHeaders all methods / origins / headers are allowed.
Example: using the library
Example: using the stack middleware
License
This package is licensed under the MIT License. See the LICENSE file for details.
All versions of cors with dependencies
symfony/http-foundation Version ^4|^5|^6
symfony/http-kernel Version ^4|^5|^6