SilverStripe\ControllerPolicy\ControllerPolicyMiddleware
This middleware accepts registrations of policies to be applied at the end of the control pipeline.
The policies will be applied in the order they are added, and will override HTTP::add_cache_headers.
Synopsis
class ControllerPolicyMiddleware
implements
HTTPMiddleware
{
- // members
- private static array $ignore_domain_regexes = ;
- protected array $requestedPolicies = ;
- // methods
- public boolean isIgnoredDomain()
- public void requestPolicy()
- public void clearPolicies()
- public HTTPResponse process()
- public bool shouldCheckHttpHost()
Hierarchy
Uses
- SilverStripe\Core\Config\Configurable
Implements
- SilverStripe\Control\Middleware\HTTPMiddleware
Members
private
- $ignore_domain_regexes
—
array
Force some domains to be ignored. Accepts one wildcard at the beginning.
protected
- $requestedPolicies
—
array
An associative array containing the 'originator' and 'policy' reference.
Methods
public
- clearPolicies()
- isIgnoredDomain() — Check if the given domain is on the list of ignored domains.
- process() — Apply all the requested policies.
- requestPolicy() — Add a policy tuple.
- shouldCheckHttpHost() — Whether the domain regexes should be checked. Can be partially mocked for unit testing.