mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 03:04:34 -04:00
Add Cors functionality and Company Settings Saver (#3060)
* Cleanup for settings remove from entities * Fixes for saving and transforming company settings * CompanySettingsSaver * Add Cors
This commit is contained in:
parent
12798b40b8
commit
6c089f994b
@ -53,6 +53,7 @@ class Kernel extends HttpKernel
|
|||||||
'throttle:60,1',
|
'throttle:60,1',
|
||||||
'bindings',
|
'bindings',
|
||||||
'query_logging',
|
'query_logging',
|
||||||
|
'cors',
|
||||||
\App\Http\Middleware\StartupCheck::class,
|
\App\Http\Middleware\StartupCheck::class,
|
||||||
],
|
],
|
||||||
'contact' => [
|
'contact' => [
|
||||||
@ -108,5 +109,6 @@ class Kernel extends HttpKernel
|
|||||||
'password_protected' => \App\Http\Middleware\PasswordProtection::class,
|
'password_protected' => \App\Http\Middleware\PasswordProtection::class,
|
||||||
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
|
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
|
||||||
'portal_enabled' => \App\Http\Middleware\ClientPortalEnabled::class,
|
'portal_enabled' => \App\Http\Middleware\ClientPortalEnabled::class,
|
||||||
|
'cors' => \App\Http\Middleware\Cors::class,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
20
app/Http/Middleware/Cors.php
Normal file
20
app/Http/Middleware/Cors.php
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
|
use Closure;
|
||||||
|
|
||||||
|
class Cors
|
||||||
|
{
|
||||||
|
|
||||||
|
public function handle($request, Closure $next)
|
||||||
|
{
|
||||||
|
|
||||||
|
return $next($request)
|
||||||
|
->header('Access-Control-Allow-Origin', '*')
|
||||||
|
->header('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS')
|
||||||
|
->header('Access-Control-Allow-Headers', 'X-Requested-With, Content-Type, X-Token-Auth, Authorization');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user