| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | public function handle($request, Closure $next) |
||
| 19 | { |
||
| 20 | $response = $next($request); |
||
| 21 | if ($response instanceof BinaryFileResponse) { |
||
| 22 | return $response; |
||
| 23 | } |
||
| 24 | $response->header('Access-Control-Allow-Origin', '*'); |
||
| 25 | // todo: add host name here |
||
| 26 | // $response->header('Access-Control-Allow-Origin', config('app.url')); |
||
| 27 | $response->header('Access-Control-Allow-Headers', 'Origin, Content-Type, Cookie, Accept'); |
||
| 28 | $response->header('Access-Control-Allow-Methods', 'GET, POST, PATCH, PUT, OPTIONS'); |
||
| 29 | |||
| 30 | // $response->header('Access-Control-Allow-Credentials', 'true'); |
||
| 31 | return $response; |
||
| 32 | } |
||
| 34 |