Provides a lightweight, extensible, framework-agnostic CORS class.
You probably want to check these specific implementations for easy installation
It's recommended that you use Composer to install Cors:
$ composer require phpnexus/corsThis package requires PHP 8.1.
TODO
Default: []
An array of allowed HTTP methods. These names are case-sensitive.
Example: ['GET', 'POST']
Default: []
Example: ['Content-Type']
Default: []
An array of allowed origins, in the form scheme://hostname.
Example: ['http://example.com', 'https://example.com']
This is not a replacement for proper access control measures.
Note: An asterisk (*) can also be used to allow any origin, but as per the specification the asterisk (*) cannot be used when Allow-Credentials is true.
Default: false
Use true to allow cookies to be sent with the request.
Note: Cannot be true when the Allow-Origin contains "*".
Default: []
Default: 0 (no cache)
Number of seconds to cache the preflight response.
- Benchmarks
The packages adheres to the SemVer specification, and there will be full backward compatibility between minor versions.
Please see CONTRIBUTING for details.
This package is released under the Apache 2.0 License. See the bundled LICENSE file for details.