Conditions | 3 |
Paths | 2 |
Total Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
18 | public function handle($request, Closure $next) |
||
19 | { |
||
20 | $content = $next($request); |
||
21 | |||
22 | if (config('flightdeck.cors.enabled') && method_exists($content, 'header')) { |
||
23 | return $content |
||
24 | ->header('Access-Control-Allow-Origin', '*') |
||
25 | ->header('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE') |
||
26 | ->header('Access-Control-Allow-Headers', 'Origin, Content-Type, Accept, Authorization, Cache-Control, X-Requested-With'); |
||
27 | } |
||
28 | |||
29 | return $content; |
||
30 | } |
||
31 | } |
||
32 |