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

CORS Issue (Access-Control-Allow-Headers) #1546

Open
ericc-ch opened this issue May 20, 2024 · 0 comments
Open

CORS Issue (Access-Control-Allow-Headers) #1546

ericc-ch opened this issue May 20, 2024 · 0 comments

Comments

@ericc-ch
Copy link

I want to mock a missing endpoint for my project. I set it up so every request that is sent, has an Authorization header. But because of that same header, my browser said that it's having a CORS error.

Access to XMLHttpRequest at 'http://localhost:3000/tasks' from origin 'http://localhost:5173' has been blocked by CORS policy: Request header field authorization is not allowed by Access-Control-Allow-Headers in preflight response.

I looked it up and apparently that's because the default options for allowedHeaders in tinyhttp/cors only allows content-type.
image

Can we have that so the default allowedHeaders is set to * ? I haven't tested it but I can try and make the PR if you want.

Thank you!

@ericc-ch ericc-ch changed the title CORS Header Issue CORS Issue (Access-Control-Allow-Headers) May 20, 2024
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

1 participant