Skip to content

phpnexus/cors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CORS

Latest Version Software License

Provides a lightweight, extensible, framework-agnostic CORS class.

You probably want to check these specific implementations for easy installation

Installation

It's recommended that you use Composer to install Cors:

$ composer require phpnexus/cors

This package requires PHP 8.1.

Usage

TODO

Configuration

Allow-Methods

Default: []

An array of allowed HTTP methods. These names are case-sensitive.

Example: ['GET', 'POST']

Allow-Headers

Default: []

Example: ['Content-Type']

Allow-Origins

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.

Allow-Credentials

Default: false

Use true to allow cookies to be sent with the request.

Note: Cannot be true when the Allow-Origin contains "*".

Expose-Headers

Default: []

Max-Age

Default: 0 (no cache)

Number of seconds to cache the preflight response.

Roadmap

  • Benchmarks

Versioning

The packages adheres to the SemVer specification, and there will be full backward compatibility between minor versions.

Contributing

Please see CONTRIBUTING for details.

License

This package is released under the Apache 2.0 License. See the bundled LICENSE file for details.

About

Provides a lightweight, extensible, framework-agnostic CORS class

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages