PHP Class Psr7Middlewares\Middleware\Csp

Afficher le fichier Open project: oscarotero/psr7-middlewares

Méthodes publiques

Méthode 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).

Method Details

__construct() public méthode

Set CSPBuilder.
public __construct ( array $policies = null )
$policies array

__invoke() public méthode

Execute the middleware.
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

addDirective() public méthode

Add a directive if it doesn't already exist If it already exists, do nothing.
public addDirective ( string $directive, mixed $value ) : self
$directive string
$value mixed
Résultat self

addSource() public méthode

Add a source to our allow whitelist.
public addSource ( string $directive, string $path ) : self
$directive string
$path string
Résultat self

supportOldBrowsers() public méthode

Whether or not support old browsers (e.g. safari).
public supportOldBrowsers ( boolean $support = true ) : self
$support boolean
Résultat self