mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-18 04:21:27 +00:00
26 lines
509 B
PHP
26 lines
509 B
PHP
<?php
|
|
|
|
namespace App\Http\Middleware;
|
|
|
|
use Closure;
|
|
|
|
class FrameGuard
|
|
{
|
|
/**
|
|
* Handle an incoming request.
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @param \Closure $next
|
|
* @return mixed
|
|
*/
|
|
public function handle($request, Closure $next)
|
|
{
|
|
$response = $next($request);
|
|
|
|
if (!$response->headers->has('X-Frame-Options')) {
|
|
$response->headers->set('X-Frame-Options', 'SAMEORIGIN', false);
|
|
}
|
|
|
|
return $response;
|
|
}
|
|
}
|