<?php namespace App\Filters;

use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use CodeIgniter\Filters\FilterInterface;

class SecurityHeaders implements FilterInterface
{
    public function before(RequestInterface $request, $arguments = null) {}
    public function after(RequestInterface $req, ResponseInterface $res, $args = null)
    {
        $res->setHeader('Strict-Transport-Security', 'max-age=31536000; includeSubDomains');
        $res->setHeader('X-Frame-Options', 'DENY');
        $res->setHeader('X-Content-Type-Options', 'nosniff');
        $res->setHeader('Referrer-Policy', 'no-referrer');
        // $res->setHeader('Content-Security-Policy', "default-src 'self'");
    }
}
