Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specific route implementation not working #8

Open
tiagoraposeira opened this issue Oct 25, 2016 · 1 comment
Open

Specific route implementation not working #8

tiagoraposeira opened this issue Oct 25, 2016 · 1 comment

Comments

@tiagoraposeira
Copy link

I'm trying to use your custom middleware to allow OPTIONS requests in Lumen, but I only managed to use it globally. When I try to use it in specific routes it still doesn't allow OPTIONS.
(MethodNotAllowedHttpException)
Am I missing something?

@davideferre
Copy link

I've the same problem! Global CORS is working fine but Route specific CORS is not working.
I've registered the middleware in my bootstrap/app.php like so:

$app->routeMiddleware([ 'cors' => palanik\lumen\Middleware\LumenCors::class, [....] ]);

then in my routes/api.php I've create a route like this:

$router->get('/brand/list', ["middleware" => "cors", "uses" => "brandController@getList"]);

but I'm always receiving Error 405 MethodNotAllowedHttpException.
How can I solve this problem @palanik ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants