You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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!
The text was updated successfully, but these errors were encountered:
ericc-ch
changed the title
CORS Header Issue
CORS Issue (Access-Control-Allow-Headers)
May 20, 2024
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.I looked it up and apparently that's because the default options for
![image](https://private-user-images.githubusercontent.com/54889298/331936512-52a04a89-713b-4073-ace2-28f6d5c60108.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ1NDgwNzYsIm5iZiI6MTcyNDU0Nzc3NiwicGF0aCI6Ii81NDg4OTI5OC8zMzE5MzY1MTItNTJhMDRhODktNzEzYi00MDczLWFjZTItMjhmNmQ1YzYwMTA4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODI1VDAxMDI1NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWNhODg1NTE4ZWRhMjcyMjRlNmE5ZTgxNTQ2YjVkNDlkNDA4OTU2Y2RkODE3MTQ2MjVmNWZkOTNmNTI4YzI2MGYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.n1c-n85TVF7BPp2lQPJFU4CPSbh6sA2dfkbWn7OxNmg)
allowedHeaders
intinyhttp/cors
only allowscontent-type
.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!
The text was updated successfully, but these errors were encountered: