mirror of https://github.com/pixelfed/pixelfed
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
509 B
PHTML
27 lines
509 B
PHTML
5 years ago
|
<?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;
|
||
|
}
|
||
|
}
|