commit
Showing
1 changed file
with
4 additions
and
4 deletions
| ... | @@ -20,12 +20,12 @@ class Cors | ... | @@ -20,12 +20,12 @@ class Cors |
| 20 | // ALLOW OPTIONS METHOD | 20 | // ALLOW OPTIONS METHOD |
| 21 | $headers = [ | 21 | $headers = [ |
| 22 | 'Access-Control-Allow-Methods'=> 'POST, GET, OPTIONS, PUT, DELETE', | 22 | 'Access-Control-Allow-Methods'=> 'POST, GET, OPTIONS, PUT, DELETE', |
| 23 | 'Access-Control-Allow-Headers'=> 'Content-Type, X-Auth-Token, Origin' | 23 | 'Access-Control-Allow-Headers'=> 'Content-Type, X-Auth-Token, Origin', |
| 24 | 'Access-Control-Max-Age'=> '28800' | ||
| 24 | ]; | 25 | ]; |
| 25 | if($request->getMethod() == "OPTIONS") { | 26 | |
| 26 | // The client-side application can set only headers allowed in Access-Control-Allow-Headers | ||
| 27 | return Response::make('OK', 200, $headers); | 27 | return Response::make('OK', 200, $headers); |
| 28 | } | 28 | |
| 29 | 29 | ||
| 30 | $response = $next($request); | 30 | $response = $next($request); |
| 31 | foreach($headers as $key => $value) | 31 | foreach($headers as $key => $value) | ... | ... |
-
Please register or sign in to post a comment