From 0bec06cd45a7f6eda0d52f78dd5ff767d94ed5cc Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 27 Dec 2019 08:56:53 -0600 Subject: [PATCH] formatting --- app/Http/Kernel.php | 2 +- app/Http/Middleware/HandleCors.php | 9 ------- config/cors.php | 40 ++++++------------------------ 3 files changed, 8 insertions(+), 43 deletions(-) delete mode 100644 app/Http/Middleware/HandleCors.php diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index b4737214aaf..c3640f30b87 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -15,7 +15,7 @@ class Kernel extends HttpKernel */ protected $middleware = [ \App\Http\Middleware\TrustProxies::class, - \App\Http\Middleware\HandleCors::class, + \Fruitcake\Cors\HandleCors::class, \App\Http\Middleware\CheckForMaintenanceMode::class, \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, \App\Http\Middleware\TrimStrings::class, diff --git a/app/Http/Middleware/HandleCors.php b/app/Http/Middleware/HandleCors.php deleted file mode 100644 index e4d0cf60da5..00000000000 --- a/app/Http/Middleware/HandleCors.php +++ /dev/null @@ -1,9 +0,0 @@ - [], + 'paths' => ['api/*'], - /* - * Matches the request method. `[*]` allows all methods. - */ 'allowed_methods' => ['*'], - /* - * Matches the request origin. `[*]` allows all origins. - */ 'allowed_origins' => ['*'], - /* - * Matches the request origin with, similar to `Request::is()` - */ 'allowed_origins_patterns' => [], - /* - * Sets the Access-Control-Allow-Headers response header. `[*]` allows all headers. - */ 'allowed_headers' => ['*'], - /* - * Sets the Access-Control-Expose-Headers response header. - */ 'exposed_headers' => false, - /* - * Sets the Access-Control-Max-Age response header. - */ 'max_age' => false, - /* - * Sets the Access-Control-Allow-Credentials header. - */ 'supports_credentials' => false, + ];