Giter Club home page Giter Club logo

Comments (4)

barryvdh avatar barryvdh commented on May 11, 2024

It should actually just return and empty response. Can you post your configuration and and example request?

from laravel-cors.

karunkshrestha avatar karunkshrestha commented on May 11, 2024

Interestingly I don't get the response in chrome, only in firebug using firefox
image

config.php

<?php

return array(

    /*
     |--------------------------------------------------------------------------
     | 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 ^/.
     |
     | allow_origin and allow_headers can be set to * to accept any value,
     | the allowed methods however have to be explicitly listed.
     |
     */
    'defaults' => array(
        'allow_credentials' => false,
        'allow_origin' => array(),
        'allow_headers' => array(),
        'allow_methods' => array(),
        'expose_headers' => array(),
        'max_age' => 0,
    ),

    'paths' => array(
        '^/v1' => array(
            'allow_origin' => array('*'),
            'allow_headers' => array('authorization','x-requested-with','apiKey'),
            'allow_methods' => array('GET','POST','PUT','DELETE'),
            'max_age' => 3600,
        ),
    ),

);

from laravel-cors.

barryvdh avatar barryvdh commented on May 11, 2024

Did this get resolved? I made some big rewrites in a new branch, by using an existing middleware.
You can checkout the stack-cors branch:

"barryvdh/laravel-cors": "dev-stack-cors@dev",

Should work with the same config, maybe that helps?

Edit: is now the 0.2.x branch

from laravel-cors.

karunkshrestha avatar karunkshrestha commented on May 11, 2024

thank you for the update. I just updated the plugin to 0.2.* and it looks it has fixed whatever issues we were having previously.

from laravel-cors.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.