You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.
// Handle the request
$response = $next($request); ///Laravel pass to next Middleware without setting cors
if ($request->getMethod() === 'OPTIONS') {
$this->cors->varyHeader($response, 'Access-Control-Request-Method');
}
return $this->addHeaders($request, $response); // Cors are added here
Since two days i've a bug with cors bc 'im in virtual machine for back office dev machine and database but on the host for front office dev from vue.js
And tu update auth user profile the browser always throw a Cors error bc missing AllowAccessControlOrigin, and true they are never set by middleware cors package.
this solution is not perfect but you can add headers in the routes web.php file on the top the file
I had the same problem with the chrome extension this is how I resolved it.
the laravel dd will not work with vue.js so use postman for debugging
hope this help
routes/web.php
<?phpheader('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE');
header('Access-Control-Allow-Headers: Content-Type, X-Auth-Token, Origin, Authorization');
useIlluminate\Support\Facades\Route;
/* |-------------------------------------------------------------------------- | Web Routes |-------------------------------------------------------------------------- | | Here is where you can register web routes for your application. These | routes are loaded by the RouteServiceProvider within a group which | contains the "web" middleware group. Now create something great! | */Route::get('/', function () {
return"hello world";
});
// Handle the request
$response = $next($request); ///Laravel pass to next Middleware without setting cors
Since two days i've a bug with cors bc 'im in virtual machine for back office dev machine and database but on the host for front office dev from vue.js
And tu update auth user profile the browser always throw a Cors error bc missing AllowAccessControlOrigin, and true they are never set by middleware cors package.
Laravel: 8.40
FruitCake: 2.0
PHP: 7.3.27
Chrome DevsTools
The text was updated successfully, but these errors were encountered: