Conditions | 4 |
Paths | 3 |
Total Lines | 26 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php |
||
14 | public function handle(Request $request, Closure $next) |
||
15 | { |
||
16 | /** @var \Illuminate\Http\Response $response */ |
||
17 | $response = $next($request); |
||
18 | |||
19 | $requestUri = $request->getUri(); |
||
20 | $excluded = config('lodash.xss.exclude_uris'); |
||
21 | if (! empty($excluded)) { |
||
22 | foreach ($excluded as $uri) { |
||
23 | if (strpos($requestUri, $uri) !== false) { |
||
24 | return $response; |
||
25 | } |
||
26 | } |
||
27 | } |
||
28 | |||
29 | /** @see http://blogs.msdn.com/b/ieinternals/archive/2010/03/30/combating-clickjacking-with-x-frame-options.aspx */ |
||
30 | $response->headers->set('X-Frame-Options', config('lodash.xss.x_frame_options'), true); |
||
31 | |||
32 | /** @see http://msdn.microsoft.com/en-us/library/ie/gg622941(v=vs.85).aspx */ |
||
33 | $response->headers->set('X-Content-Type-Options', config('lodash.xss.x_content_type_options'), true); |
||
34 | |||
35 | /** @see http://msdn.microsoft.com/en-us/library/dd565647(v=vs.85).aspx */ |
||
36 | $response->headers->set('X-XSS-Protection', config('lodash.xss.x_xss_protection'), true); |
||
37 | |||
38 | return $response; |
||
39 | } |
||
40 | } |
||
41 |