PHP 클래스 Psr7Middlewares\Middleware\Csp

파일 보기 프로젝트 열기: oscarotero/psr7-middlewares

공개 메소드들

메소드 설명
__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).

메소드 상세

__construct() 공개 메소드

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

__invoke() 공개 메소드

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
리턴 Psr\Http\Message\ResponseInterface

addDirective() 공개 메소드

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
리턴 self

addSource() 공개 메소드

Add a source to our allow whitelist.
public addSource ( string $directive, string $path ) : self
$directive string
$path string
리턴 self

supportOldBrowsers() 공개 메소드

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