Documentation

Headers
in package

Headers controller class.

Table of Contents

CSP_IMG  = ['https://api.yetiforce.eu']
$csp  : array<string|int, string>
Default CSP header values.
$instance  : self
Headers instance.
$headers  : array<string|int, string>
Default header values.
$headersToDelete  : array<string|int, string>
Headers to delete.
__construct()  : mixed
Construct, loads default headers depending on the browser and environment.
generateCspToken()  : void
Generate Content Security Policy token.
getCspHeader()  : string
Get CSP headers string.
getHeaders()  : array<string|int, string>
Get headers string.
getInstance()  : self
Get headers instance.
loadCsp()  : void
Load CSP directive.
send()  : void
Send headers.
setHeader()  : mixed
Set header.

Constants

CSP_IMG

private mixed CSP_IMG = ['https://api.yetiforce.eu']
Tags
todo

remove one addres

Properties

$csp

Default CSP header values.

public array<string|int, string> $csp = ['default-src' => '\'self\' blob:', 'img-src' => '\'self\' data:', 'font-src' => '\'self\' data:', 'script-src' => '\'self\' \'unsafe-inline\' blob:', 'form-action' => '\'self\'', 'frame-ancestors' => '\'self\'', 'frame-src' => '\'self\' mailto: tel:', 'style-src' => '\'self\' \'unsafe-inline\'', 'connect-src' => '\'self\'']

$instance

Headers instance.

public static self $instance

.

$headers

Default header values.

protected array<string|int, string> $headers = ['Access-Control-Allow-Methods' => 'GET, POST', 'Access-Control-Allow-Origin' => '*', 'Expires' => '-', 'Last-Modified' => '-', 'Pragma' => 'no-cache', 'Cache-Control' => 'private, no-cache, no-store, must-revalidate, post-check=0, pre-check=0', 'Content-Type' => 'text/html; charset=UTF-8', 'Referrer-Policy' => 'no-referrer', 'Expect-Ct' => 'enforce; max-age=3600', 'X-Frame-Options' => 'sameorigin', 'X-Xss-Protection' => '1; mode=block', 'X-Content-Type-Options' => 'nosniff', 'X-Robots-Tag' => 'none', 'X-Permitted-Cross-Domain-Policies' => 'none']

$headersToDelete

Headers to delete.

protected array<string|int, string> $headersToDelete = ['X-Powered-By', 'Server']

Methods

__construct()

Construct, loads default headers depending on the browser and environment.

public __construct() : mixed
Return values
mixed

generateCspToken()

Generate Content Security Policy token.

public static generateCspToken() : void
Return values
void

getCspHeader()

Get CSP headers string.

public getCspHeader() : string
Return values
string

getHeaders()

Get headers string.

public getHeaders() : array<string|int, string>
Return values
array<string|int, string>

getInstance()

Get headers instance.

public static getInstance() : self
Return values
self

loadCsp()

Load CSP directive.

public loadCsp() : void
Return values
void

send()

Send headers.

public send() : void
Return values
void

setHeader()

Set header.

public setHeader(string $key, string $value) : mixed
Parameters
$key : string
$value : string
Return values
mixed

        

Search results