| Conditions | 3 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 38 | private function addCorsHeaders($response) |
||
| 39 | { |
||
| 40 | if (! $response->headers->has('Access-Control-Allow-Origin')) { |
||
| 41 | $response = $response->header('Access-Control-Allow-Origin', config('tma-helper.cors.allowedOrigins', 'localhost')) |
||
|
|
|||
| 42 | ->header('Access-Control-Allow-Methods', config('tma-helper.cors.allowedMethods')); |
||
| 43 | |||
| 44 | foreach (config('tma-helper.cors.headers', []) as $header => $value) { |
||
| 45 | $response->header($header, $value); |
||
| 46 | } |
||
| 47 | } |
||
| 48 | |||
| 49 | return $response; |
||
| 50 | } |
||
| 52 |