Some checks failed
Tests / PHP 8.1 (push) Has been cancelled
Tests / PHP 8.2 (push) Has been cancelled
Tests / PHP 8.3 (push) Has been cancelled
33 lines
910 B
PHP
33 lines
910 B
PHP
<?php
|
|
|
|
namespace App\Http\Middleware;
|
|
|
|
use Closure;
|
|
|
|
class AddXHeader
|
|
{
|
|
/**
|
|
* Handle an incoming request.
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @param \Closure $next
|
|
* @return mixed
|
|
*/
|
|
public function handle($request, Closure $next)
|
|
{
|
|
$response = $next($request);
|
|
|
|
// Check if we should add header
|
|
if (method_exists($response, 'header')) {
|
|
$response->header('X-Akaunting', 'Online Accounting Software');
|
|
$response->header('X-Content-Type-Options', 'nosniff');
|
|
$response->header('X-Frame-Options', 'SAMEORIGIN');
|
|
$response->header('Referrer-Policy', 'strict-origin-when-cross-origin');
|
|
$response->header('X-XSS-Protection', '0');
|
|
$response->header('Permissions-Policy', 'camera=(), microphone=(), geolocation=()');
|
|
}
|
|
|
|
return $response;
|
|
}
|
|
}
|