CSPConvertor
in package
class \Firesphere\CSPHeaders\Helpers\CSPConvertor
Helper class to convert a manually written CSP header to YML
Table of Contents
Properties
- $non_url_args : array<string|int, array<string|int, mixed>>
- $non_url_defaults : array<string|int, string>
Methods
- toYml() : string|void
Properties
$non_url_args
private
static array<string|int, array<string|int, mixed>>
$non_url_args
= ['script-src' => ['unsafe-inline', 'unsafe-eval', 'unsafe-hashes', 'strict-dynamic'], 'script-src-elem' => ['unsafe-inline', 'unsafe-eval', 'unsafe-hashes', 'strict-dynamic'], 'script-src-attr' => ['unsafe-inline', 'unsafe-eval', 'unsafe-hashes', 'strict-dynamic'], 'style-src' => ['unsafe-inline'], 'style-src-elem' => ['unsafe-inline'], 'style-src-attr' => ['unsafe-inline'], 'img-src' => ['data:', 'blob:']]
Values for different header parts to be allowed
$non_url_defaults
private
static array<string|int, string>
$non_url_defaults
= ['self']
default values allowed
Methods
toYml()
public
static toYml(HTTPResponse $response[, mixed $return = false ]) : string|void
Parameters
- $response : HTTPResponse
- $return : mixed = false