-
Notifications
You must be signed in to change notification settings - Fork 17
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
Route Middleware not work #8
Comments
Your code looks ok and I am able to run it locally with correct cors response. Could you add
|
Nothing, I get the same error: The code:
|
The issue is with pre-flight call. With $app->options('/item',
\CorsSlim\CorsSlim::routeMiddleware(),
function () use ($app) {}
); No need to return any response. |
Hi!
This is my code, but not work:
The error:
XMLHttpRequest cannot load [...]. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access.
If I use this code, it works. But I need apply only in one route:
The text was updated successfully, but these errors were encountered: