Conditions | 1 |
Paths | 1 |
Total Lines | 22 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | public function loadMiddleware() |
||
17 | { |
||
18 | $this->app->add(function ($request, $response, $next) { |
||
19 | $response = $response-> |
||
20 | withAddedHeader('Access-Control-Allow-Origin', $request->getHeader('Origin'))-> |
||
21 | withAddedHeader('Access-Control-Allow-Credentials', 'true')-> |
||
22 | withAddedHeader('Access-Control-Expose-Headers', 'X-TOTAL-COUNT')-> |
||
23 | withAddedHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE')-> |
||
24 | withAddedHeader( |
||
25 | 'Access-Control-Allow-Headers', |
||
26 | 'X-XSRF-TOKEN, Content-Type, X-REQUEST-TOTAL-COUNT, Authorization' |
||
27 | ); |
||
28 | $response = $next($request, $response); |
||
29 | return $response; |
||
30 | }); |
||
31 | |||
32 | $this->app->add(function ($request, $response, $next) { |
||
33 | $response = $response-> |
||
34 | withHeader('Content-Type', 'application/vnd.seedapp.v1+json'); |
||
35 | |||
36 | $response = $next($request, $response); |
||
37 | return $response; |
||
38 | }); |
||
41 |