Méthode | Description | |
---|---|---|
__construct ( Neomerx\Cors\Contracts\Strategies\SettingsStrategyInterface $settings = null ) | Defines the settings used. | |
__invoke ( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, callable $next ) : Psr\Http\Message\ResponseInterface | Execute the middleware. | |
allowCredentials ( boolean $allow = true ) : self | If access with credentials is supported by the resource. | |
allowedHeaders ( array $headers, boolean $force = false ) : self | Set allowed headers. | |
allowedMethods ( array $methods, boolean $force = false ) : self | Set allowed methods. | |
allowedOrigins ( array $origins ) : self | Set allowed origins. | |
checkHost ( boolean $checkHost = true ) : self | If request 'Host' header should be checked against server's origin. | |
exposedHeaders ( array $headers ) : self | Set headers other than the simple ones that might be exposed to user agent. | |
maxAge ( integer $maxAge ) : self | Set pre-flight cache max period in seconds. | |
origin ( string | array $origin ) : self | Set the server origin. |
public __construct ( Neomerx\Cors\Contracts\Strategies\SettingsStrategyInterface $settings = null ) | ||
$settings | Neomerx\Cors\Contracts\Strategies\SettingsStrategyInterface |
public __invoke ( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, callable $next ) : Psr\Http\Message\ResponseInterface | ||
$request | Psr\Http\Message\ServerRequestInterface | |
$response | Psr\Http\Message\ResponseInterface | |
$next | callable | |
Résultat | Psr\Http\Message\ResponseInterface |
public allowCredentials ( boolean $allow = true ) : self | ||
$allow | boolean | |
Résultat | self |
public allowedHeaders ( array $headers, boolean $force = false ) : self | ||
$headers | array | |
$force | boolean | If allowed headers should be added to pre-flight response |
Résultat | self |
public allowedMethods ( array $methods, boolean $force = false ) : self | ||
$methods | array | |
$force | boolean | If allowed methods should be added to pre-flight response |
Résultat | self |
public allowedOrigins ( array $origins ) : self | ||
$origins | array | |
Résultat | self |
public exposedHeaders ( array $headers ) : self | ||
$headers | array | |
Résultat | self |