|
@@ -16,21 +16,21 @@ class EnableCrossRequestMiddleware |
|
@@ -16,21 +16,21 @@ class EnableCrossRequestMiddleware |
|
16
|
public function handle($request, Closure $next)
|
16
|
public function handle($request, Closure $next)
|
|
17
|
{
|
17
|
{
|
|
18
|
$response = $next($request);
|
18
|
$response = $next($request);
|
|
19
|
-// $origin = $request->server('HTTP_ORIGIN') ?: '';
|
|
|
|
20
|
-//// $allow_origin = [
|
|
|
|
21
|
-//// 'http://localhost:8080',
|
|
|
|
22
|
-//// ];
|
|
|
|
23
|
-//// if (in_array($origin, $allow_origin)) {
|
|
|
|
24
|
-// $header = [
|
|
|
|
25
|
-//// 'Access-Control-Allow-Origin' => $origin,
|
|
|
|
26
|
-// 'Access-Control-Allow-Origin' => '*',
|
|
|
|
27
|
-// 'Access-Control-Allow-Headers' => '*',
|
|
|
|
28
|
-// 'Access-Control-Expose-Headers' => '*',
|
|
|
|
29
|
-// 'Access-Control-Allow-Methods' => 'POST, GET, OPTIONS',
|
|
|
|
30
|
-// 'Access-Control-Allow-Credentials' => 'true',
|
|
|
|
31
|
-// ];
|
|
|
|
32
|
-// $response->headers->add($header);
|
|
|
|
33
|
-//// }
|
19
|
+ $origin = $request->server('HTTP_ORIGIN') ?: '';
|
|
|
|
20
|
+// $allow_origin = [
|
|
|
|
21
|
+// 'http://localhost:8080',
|
|
|
|
22
|
+// ];
|
|
|
|
23
|
+// if (in_array($origin, $allow_origin)) {
|
|
|
|
24
|
+ $header = [
|
|
|
|
25
|
+// 'Access-Control-Allow-Origin' => $origin,
|
|
|
|
26
|
+ 'Access-Control-Allow-Origin' => '*',
|
|
|
|
27
|
+ 'Access-Control-Allow-Headers' => '*',
|
|
|
|
28
|
+ 'Access-Control-Expose-Headers' => '*',
|
|
|
|
29
|
+ 'Access-Control-Allow-Methods' => 'POST, GET, OPTIONS',
|
|
|
|
30
|
+ 'Access-Control-Allow-Credentials' => 'true',
|
|
|
|
31
|
+ ];
|
|
|
|
32
|
+ $response->headers->add($header);
|
|
|
|
33
|
+// }
|
|
34
|
return $response;
|
34
|
return $response;
|
|
35
|
}
|
35
|
}
|
|
36
|
} |
36
|
} |