Update core 8.3.0
This commit is contained in:
parent
da7a7918f8
commit
cd7a898e66
6144 changed files with 132297 additions and 87747 deletions
47
web/vendor/asm89/stack-cors/README.md
vendored
47
web/vendor/asm89/stack-cors/README.md
vendored
|
|
@ -2,12 +2,11 @@
|
|||
|
||||
Library and middleware enabling cross-origin resource sharing for your
|
||||
http-{foundation,kernel} using application. It attempts to implement the
|
||||
[W3C Candidate Recommendation] for cross-origin resource sharing.
|
||||
[W3C Recommendation] for cross-origin resource sharing.
|
||||
|
||||
[W3C Candidate Recommendation]: http://www.w3.org/TR/cors/
|
||||
[W3C Recommendation]: http://www.w3.org/TR/cors/
|
||||
|
||||
Master [](http://travis-ci.org/asm89/stack-cors)
|
||||
Develop [](http://travis-ci.org/asm89/stack-cors)
|
||||
|
||||
## Installation
|
||||
|
||||
|
|
@ -15,27 +14,11 @@ Require `asm89/stack-cors` using composer.
|
|||
|
||||
## Usage
|
||||
|
||||
Stack middleware:
|
||||
This package can be used as a library or as [stack middleware].
|
||||
|
||||
```php
|
||||
<?php
|
||||
[stack middleware]: http://stackphp.com/
|
||||
|
||||
use Asm89\Stack\Cors;
|
||||
|
||||
$app = new Cors($app, array(
|
||||
// you can use array('*') to allow any headers
|
||||
'allowedHeaders' => array('x-allowed-header', 'x-other-allowed-header'),
|
||||
// you can use array('*') to allow any methods
|
||||
'allowedMethods' => array('DELETE', 'GET', 'POST', 'PUT'),
|
||||
// you can use array('*') to allow requests from any origin
|
||||
'allowedOrigins' => array('localhost'),
|
||||
'exposedHeaders' => false,
|
||||
'maxAge' => false,
|
||||
'supportsCredentials' => false,
|
||||
));
|
||||
```
|
||||
|
||||
Or use the library:
|
||||
### Example: using the library
|
||||
|
||||
```php
|
||||
<?php
|
||||
|
|
@ -57,3 +40,23 @@ $cors->isActualRequestAllowed(Request $request);
|
|||
$cors->isCorsRequest(Request $request);
|
||||
$cors->isPreflightRequest(Request $request);
|
||||
```
|
||||
|
||||
## Example: using the stack middleware
|
||||
|
||||
```php
|
||||
<?php
|
||||
|
||||
use Asm89\Stack\Cors;
|
||||
|
||||
$app = new Cors($app, array(
|
||||
// you can use array('*') to allow any headers
|
||||
'allowedHeaders' => array('x-allowed-header', 'x-other-allowed-header'),
|
||||
// you can use array('*') to allow any methods
|
||||
'allowedMethods' => array('DELETE', 'GET', 'POST', 'PUT'),
|
||||
// you can use array('*') to allow requests from any origin
|
||||
'allowedOrigins' => array('localhost'),
|
||||
'exposedHeaders' => false,
|
||||
'maxAge' => false,
|
||||
'supportsCredentials' => false,
|
||||
));
|
||||
```
|
||||
|
|
|
|||
Reference in a new issue