mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 21:22:58 +01:00
commit
8baaaa10c7
@ -41,7 +41,6 @@ use App\Http\Middleware\TrustProxies;
|
||||
use App\Http\Middleware\UrlSetDb;
|
||||
use App\Http\Middleware\UserVerified;
|
||||
use App\Http\Middleware\VerifyCsrfToken;
|
||||
use App\Http\Middleware\WebCors;
|
||||
use Illuminate\Auth\Middleware\AuthenticateWithBasicAuth;
|
||||
use Illuminate\Auth\Middleware\Authorize;
|
||||
use Illuminate\Auth\Middleware\EnsureEmailIsVerified;
|
||||
@ -73,7 +72,6 @@ class Kernel extends HttpKernel
|
||||
TrustProxies::class,
|
||||
// \Fruitcake\Cors\HandleCors::class,
|
||||
Cors::class,
|
||||
WebCors::class,
|
||||
|
||||
];
|
||||
|
||||
@ -87,12 +85,10 @@ class Kernel extends HttpKernel
|
||||
EncryptCookies::class,
|
||||
AddQueuedCookiesToResponse::class,
|
||||
StartSession::class,
|
||||
// \Illuminate\Session\Middleware\AuthenticateSession::class,
|
||||
ShareErrorsFromSession::class,
|
||||
VerifyCsrfToken::class,
|
||||
SubstituteBindings::class,
|
||||
QueryLogging::class,
|
||||
WebCors::class,
|
||||
],
|
||||
|
||||
'api' => [
|
||||
@ -167,6 +163,7 @@ class Kernel extends HttpKernel
|
||||
|
||||
|
||||
protected $middlewarePriority = [
|
||||
Cors::class,
|
||||
SetDomainNameDb::class,
|
||||
SetDb::class,
|
||||
SetWebDb::class,
|
||||
|
@ -28,6 +28,6 @@ class VerifyCsrfToken extends Middleware
|
||||
* @var array
|
||||
*/
|
||||
protected $except = [
|
||||
//
|
||||
'livewire/message/*'
|
||||
];
|
||||
}
|
||||
|
@ -1,36 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Support\Facades\Response;
|
||||
use Symfony\Component\HttpFoundation\BinaryFileResponse;
|
||||
|
||||
class WebCors
|
||||
{
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
if ($request->getMethod() == 'OPTIONS') {
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
|
||||
// ALLOW OPTIONS METHOD
|
||||
$headers = [
|
||||
'Access-Control-Allow-Methods'=> 'POST, GET, OPTIONS, PUT, DELETE',
|
||||
'Access-Control-Allow-Headers'=> 'X-API-COMPANY-KEY,X-CLIENT-VERSION,X-API-SECRET,X-API-TOKEN,X-API-PASSWORD,DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,X-CSRF-TOKEN,X-LIVEWIRE',
|
||||
];
|
||||
|
||||
return Response::make('OK', 200, $headers);
|
||||
}
|
||||
|
||||
$response = $next($request);
|
||||
|
||||
$response->headers->set('Access-Control-Allow-Origin', $request->getSchemeAndHttpHost());
|
||||
$response->headers->set('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
|
||||
$response->headers->set('Access-Control-Allow-Headers', 'X-API-COMPANY-KEY,X-API-SECRET,X-API-TOKEN,X-API-PASSWORD,DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,X-CSRF-TOKEN,X-LIVEWIRE');
|
||||
$response->headers->set('Access-Control-Expose-Headers', 'X-APP-VERSION,X-MINIMUM-CLIENT-VERSION');
|
||||
$response->headers->set('X-APP-VERSION', config('ninja.app_version'));
|
||||
$response->headers->set('X-MINIMUM-CLIENT-VERSION', config('ninja.minimum_client_version'));
|
||||
|
||||
return $response;
|
||||
}
|
||||
}
|
@ -44,7 +44,7 @@ class SchedulerCheck implements ShouldQueue
|
||||
{
|
||||
|
||||
try {
|
||||
Artisan::call('migrate', ['--force' => true]);
|
||||
Artisan::call('migrate', ['--force' => 'true']);
|
||||
} catch (\Exception $e) {
|
||||
nlog("I wasn't able to migrate the data.");
|
||||
nlog($e->getMessage());
|
||||
|
Loading…
Reference in New Issue
Block a user