InitialisationMiddleware
class InitialisationMiddleware implements HTTPMiddleware (View source)
Initialises CWP-specific configuration settings, to avoid _config.php.
Traits
Provides extensions to this object to integrate it with standard config API methods.
Config options
xss_protection_enabled | bool | Disable the automatically added 'X-XSS-Protection' header that is added to all responses. This should be left alone in most circumstances to include the header. Refer to Mozilla Developer Network for more information: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection |
|
egress_proxy_default_enabled | bool | Enable egress proxy. This works on the principle of setting http(s)_proxy environment variables, which will be automatically picked up by curl. This means RestfulService and raw curl requests should work out of the box. Stream-based requests need extra manual configuration. |
|
egress_proxy_exclude_domains | string[] | Configure the list of domains to bypass proxy by setting the NO_PROXY environment variable. |
|
strict_transport_security | string | Provide a value for the HTTP Strict Transport Security header. |
Properties
Methods
Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .....).
Gets the uninherited value for the given config option
If the outbound egress proxy details have been defined in environment variables, configure the proxy variables that are used to configure it.
Configure any domains that should be excluded from egress proxy rules and provide them to the environment
Details
static Config_ForClass
config()
Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .....).
mixed
stat(string $name)
deprecated
deprecated
Get inherited config value
mixed
uninherited(string $name)
Gets the uninherited value for the given config option
$this
set_stat(string $name, mixed $value)
deprecated
deprecated
Update the config value for a given property
HTTPResponse
process(HTTPRequest $request, callable $delegate)
Generate response for the given request
protected
configureEgressProxy()
If the outbound egress proxy details have been defined in environment variables, configure the proxy variables that are used to configure it.
protected
configureProxyDomainExclusions()
Configure any domains that should be excluded from egress proxy rules and provide them to the environment