mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 21:24:13 -08:00
Merge pull request #10720 from uberbrady/fix_cors_develop
Fix cors develop
This commit is contained in:
commit
292bf21e7d
|
@ -24,6 +24,7 @@ class Kernel extends HttpKernel
|
||||||
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
|
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
|
||||||
\App\Http\Middleware\SecurityHeaders::class,
|
\App\Http\Middleware\SecurityHeaders::class,
|
||||||
\App\Http\Middleware\PreventBackHistory::class,
|
\App\Http\Middleware\PreventBackHistory::class,
|
||||||
|
\Fruitcake\Cors\HandleCors::class,
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -44,7 +45,6 @@ class Kernel extends HttpKernel
|
||||||
],
|
],
|
||||||
|
|
||||||
'api' => [
|
'api' => [
|
||||||
\Fruitcake\Cors\HandleCors::class,
|
|
||||||
'throttle:120,1',
|
'throttle:120,1',
|
||||||
'auth:api',
|
'auth:api',
|
||||||
],
|
],
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
$allowed_origins = env('CORS_ALLOWED_ORIGINS') !== null ?
|
||||||
|
explode(',', env('CORS_ALLOWED_ORIGINS')) : [];
|
||||||
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
||||||
'supportsCredentials' => false,
|
'supportsCredentials' => false,
|
||||||
|
|
||||||
'allowedOrigins' => ['*'],
|
'allowedOrigins' => $allowed_origins,
|
||||||
|
|
||||||
'allowedHeaders' => ['*'],
|
'allowedHeaders' => ['*'],
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue