1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

Laravel Cross-Origin Read Blocking (CORB) blocked

Discussão em 'Outras Linguagens' iniciado por JayDev95, Setembro 28, 2024 às 02:42.

  1. JayDev95

    JayDev95 Guest

    I have a form in my Laravel application creating a post where the user can upload an image. When the post is created the image is not showing up. I have this warning about CORB in my browser and believe that is the reason. So, I ran php artisan config:publish cors to create the config file:

    <?php

    return [

    /*
    |--------------------------------------------------------------------------
    | Cross-Origin Resource Sharing (CORS) Configuration
    |--------------------------------------------------------------------------
    |
    | Here you may configure your settings for cross-origin resource sharing
    | or "CORS". This determines what cross-origin operations may execute
    | in web browsers. You are free to adjust these settings as needed.
    |
    | To learn more: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
    |
    */

    'paths' => ['api/*', 'sanctum/csrf-cookie', '*'],

    'allowed_methods' => ['*'], // Keep it flexible or specify methods like GET, POST, etc.

    'allowed_origins' => ['http://127.0.0.1:8000', 'http://localhost', '*'], // Explicitly allow local domains

    'allowed_origins_patterns' => [],

    'allowed_headers' => ['*'], // Allow all headers or specify the ones you need

    'exposed_headers' => [],

    'max_age' => 0,

    'supports_credentials' => true, // Set to true if you need to send cookies or auth headers
    ];


    Then, ran php artisan config:clear, but the images are still being blocked. [​IMG]

    [​IMG]

    Continue reading...

Compartilhe esta Página