2016-03-25 01:18:05 -07:00
|
|
|
<?php
|
|
|
|
namespace App\Http\Middleware;
|
|
|
|
|
|
|
|
use Closure;
|
|
|
|
|
|
|
|
class XssProtectHeader
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Handle the given request and get the response.
|
|
|
|
*
|
|
|
|
* @param \Illuminate\Http\Request $request
|
|
|
|
* @param \Closure $next
|
|
|
|
* @return \Illuminate\Http\Response
|
|
|
|
*/
|
|
|
|
public function handle($request, Closure $next)
|
|
|
|
{
|
2017-09-28 17:34:47 -07:00
|
|
|
$mode = '1; mode=block';
|
2016-03-25 01:18:05 -07:00
|
|
|
$response = $next($request);
|
2017-09-28 16:28:27 -07:00
|
|
|
$response->headers->set('X-XSS-Protection', $mode);
|
2016-03-25 01:18:05 -07:00
|
|
|
return $response;
|
|
|
|
}
|
|
|
|
}
|