public static function init()
    {
        self::add(self::HEADER_SET_COOKIE, '__Host-sess=' . session_id() . '; path=' . Request::$subfolders . '; Secure; HttpOnly; SameSite;');
        if (Request::isSecure()) {
            self::add(self::HEADER_CONTENT_SECURITY_POLICY, self::HEADER_CONTENT_SECURITY_POLICY_CONTENT_SECURE);
            self::add(self::HEADER_STRICT_TRANSPORT_SECURITY, self::HEADER_STRICT_TRANSPORT_SECURITY_CONTENT);
            self::add(self::HEADER_X_CONTENT_SECURITY_POLICY, self::HEADER_CONTENT_SECURITY_POLICY_CONTENT_SECURE);
        } elseif (Request::isLocalhost()) {
            self::add(self::HEADER_CONTENT_SECURITY_POLICY, self::HEADER_CONTENT_SECURITY_POLICY_CONTENT_LOCALHOST);
            self::add(self::HEADER_X_CONTENT_SECURITY_POLICY, self::HEADER_CONTENT_SECURITY_POLICY_CONTENT_LOCALHOST);
        } else {
            self::add(self::HEADER_CONTENT_SECURITY_POLICY, self::HEADER_CONTENT_SECURITY_POLICY_CONTENT_INSECURE);
            self::add(self::HEADER_X_CONTENT_SECURITY_POLICY, self::HEADER_CONTENT_SECURITY_POLICY_CONTENT_INSECURE);
        }
        self::$initialized = true;
    }
public static function init()
    {
        self::add(self::HEADER_SET_COOKIE, '__Host-sess=' . session_id() . '; path=' . Request::$subfolders . '; Secure; HttpOnly; SameSite;');
        if (Request::isSecure()) {
            self::add(self::HEADER_CONTENT_SECURITY_POLICY, self::HEADER_CONTENT_SECURITY_POLICY_CONTENT_SECURE);
            self::add(self::HEADER_STRICT_TRANSPORT_SECURITY, self::HEADER_STRICT_TRANSPORT_SECURITY_CONTENT);
            self::add(self::HEADER_X_CONTENT_SECURITY_POLICY, self::HEADER_CONTENT_SECURITY_POLICY_CONTENT_SECURE);
        } elseif (Request::isLocalhost()) {
            self::add(self::HEADER_CONTENT_SECURITY_POLICY, self::HEADER_CONTENT_SECURITY_POLICY_CONTENT_LOCALHOST);
            self::add(self::HEADER_X_CONTENT_SECURITY_POLICY, self::HEADER_CONTENT_SECURITY_POLICY_CONTENT_LOCALHOST);
        } else {
            self::add(self::HEADER_CONTENT_SECURITY_POLICY, self::HEADER_CONTENT_SECURITY_POLICY_CONTENT_INSECURE);
            self::add(self::HEADER_X_CONTENT_SECURITY_POLICY, self::HEADER_CONTENT_SECURITY_POLICY_CONTENT_INSECURE);
        }
        self::$initialized = true;
    }
public static function init ( ) { self :: add ( self :: HEADER_SET_COOKIE , '__Host-sess=' . session_id ( ) . '; path=' . Request :: $ subfolders . '; Secure; HttpOnly; SameSite;' ) ; if ( Request :: isSecure ( ) ) { self :: add ( self :: HEADER_CONTENT_SECURITY_POLICY , self :: HEADER_CONTENT_SECURITY_POLICY_CONTENT_SECURE ) ; self :: add ( self :: HEADER_STRICT_TRANSPORT_SECURITY , self :: HEADER_STRICT_TRANSPORT_SECURITY_CONTENT ) ; self :: add ( self :: HEADER_X_CONTENT_SECURITY_POLICY , self :: HEADER_CONTENT_SECURITY_POLICY_CONTENT_SECURE ) ; } elseif ( Request :: isLocalhost ( ) ) { self :: add ( self :: HEADER_CONTENT_SECURITY_POLICY , self :: HEADER_CONTENT_SECURITY_POLICY_CONTENT_LOCALHOST ) ; self :: add ( self :: HEADER_X_CONTENT_SECURITY_POLICY , self :: HEADER_CONTENT_SECURITY_POLICY_CONTENT_LOCALHOST ) ; } else { self :: add ( self :: HEADER_CONTENT_SECURITY_POLICY , self :: HEADER_CONTENT_SECURITY_POLICY_CONTENT_INSECURE ) ; self :: add ( self :: HEADER_X_CONTENT_SECURITY_POLICY , self :: HEADER_CONTENT_SECURITY_POLICY_CONTENT_INSECURE ) ; } self :: $ initialized = true ; }
Adds content security policy headers
Adds content security policy headers