PHP Class Psr7Middlewares\Middleware\Https

Inheritance: use trait Psr7Middlewares\Utils\RedirectTrait
Show file Open project: oscarotero/psr7-middlewares

Public Methods

Method Description
__construct ( ) Set basic config.
__invoke ( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, callable $next ) : Psr\Http\Message\ResponseInterface Execute the middleware.
checkHttpsForward ( boolean $checkHttpsForward = true ) : self Configure whether check the following headers before redirect: X-Forwarded-Proto: https X-Forwarded-Port: 443.
includeSubdomains ( boolean $includeSubdomains = true ) : self Configure the includeSubDomains HSTS directive.
maxAge ( integer $maxAge ) : self Configure the max-age HSTS in seconds.

Method Details

__construct() public method

Set basic config.
public __construct ( )

__invoke() public method

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

checkHttpsForward() public method

Configure whether check the following headers before redirect: X-Forwarded-Proto: https X-Forwarded-Port: 443.
public checkHttpsForward ( boolean $checkHttpsForward = true ) : self
$checkHttpsForward boolean
return self

includeSubdomains() public method

Configure the includeSubDomains HSTS directive.
public includeSubdomains ( boolean $includeSubdomains = true ) : self
$includeSubdomains boolean
return self

maxAge() public method

Configure the max-age HSTS in seconds.
public maxAge ( integer $maxAge ) : self
$maxAge integer
return self