Method | Description | |
---|---|---|
__construct ( array $policies = null ) | Set CSPBuilder. | |
__invoke ( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, callable $next ) : Psr\Http\Message\ResponseInterface | Execute the middleware. | |
addDirective ( string $directive, mixed $value ) : self | Add a directive if it doesn't already exist If it already exists, do nothing. | |
addSource ( string $directive, string $path ) : self | Add a source to our allow whitelist. | |
supportOldBrowsers ( boolean $support = true ) : self | Whether or not support old browsers (e.g. safari). |
public __construct ( array $policies = null ) | ||
$policies | array |
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 | |
return | Psr\Http\Message\ResponseInterface |
public addDirective ( string $directive, mixed $value ) : self | ||
$directive | string | |
$value | mixed | |
return | self |
public supportOldBrowsers ( boolean $support = true ) : self | ||
$support | boolean | |
return | self |