Fixes #628 - Handle Cors properly.
This commit is contained in:
@@ -161,6 +161,7 @@ return [
|
||||
'McCool\LaravelAutoPresenter\LaravelAutoPresenterServiceProvider',
|
||||
'PragmaRX\Google2FA\Vendor\Laravel\ServiceProvider',
|
||||
'Roumen\Feed\FeedServiceProvider',
|
||||
'Barryvdh\Cors\CorsServiceProvider',
|
||||
|
||||
/*
|
||||
* Application Service Providers...
|
||||
|
||||
37
config/cors.php
Normal file
37
config/cors.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Laravel CORS Defaults
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The defaults are the default values applied to all the paths that match,
|
||||
| unless overridden in a specific URL configuration.
|
||||
| If you want them to apply to everything, you must define a path with *.
|
||||
|
|
||||
| allowedOrigins, allowedHeaders and allowedMethods can be set to ['*']
|
||||
| to accept any value, the allowed methods however have to be explicitly listed.
|
||||
|
|
||||
*/
|
||||
'defaults' => [
|
||||
'supportsCredentials' => true,
|
||||
'allowedOrigins' => [],
|
||||
'allowedHeaders' => [],
|
||||
'allowedMethods' => [],
|
||||
'exposedHeaders' => [],
|
||||
'maxAge' => 0,
|
||||
'hosts' => [],
|
||||
],
|
||||
|
||||
'paths' => [
|
||||
'api/v1/*' => [
|
||||
'allowedOrigins' => [],
|
||||
'allowedHeaders' => ['X-Cachet-Token'],
|
||||
'allowedMethods' => ['*'],
|
||||
'maxAge' => 3600,
|
||||
],
|
||||
],
|
||||
|
||||
];
|
||||
Reference in New Issue
Block a user