Skip to content

Commit

Permalink
Merge pull request #10720 from uberbrady/fix_cors_develop
Browse files Browse the repository at this point in the history
Fix cors develop
  • Loading branch information
snipe authored Feb 23, 2022
2 parents 6ef053b + 294606f commit 292bf21
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class Kernel extends HttpKernel
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
\App\Http\Middleware\SecurityHeaders::class,
\App\Http\Middleware\PreventBackHistory::class,
\Fruitcake\Cors\HandleCors::class,

];

Expand All @@ -44,7 +45,6 @@ class Kernel extends HttpKernel
],

'api' => [
\Fruitcake\Cors\HandleCors::class,
'throttle:120,1',
'auth:api',
],
Expand Down
6 changes: 5 additions & 1 deletion config/cors.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
<?php

$allowed_origins = env('CORS_ALLOWED_ORIGINS') !== null ?
explode(',', env('CORS_ALLOWED_ORIGINS')) : [];


return [

'supportsCredentials' => false,

'allowedOrigins' => ['*'],
'allowedOrigins' => $allowed_origins,

'allowedHeaders' => ['*'],

Expand Down

0 comments on commit 292bf21

Please sign in to comment.