1
0
Fork 1
mirror of https://github.com/pixelfed/pixelfed.git synced 2024-12-27 10:16:47 +00:00
pixelfed/app/Http/Middleware/FrameGuard.php

27 lines
509 B
PHP
Raw Normal View History

2019-11-24 05:18:51 +00:00
<?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;
}
}