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
Hi Michael,
When calling resolve(event), SvelteKit searches your project for the specified route.
If you do not have a /some/path/+server.js file with an exported OPTIONS() method, Kit, rightly responds that the method is not allowed.
If you want a catch-all OPTIONS handler, you'll need to add something like this to your hooks: #5193 (comment)
Note the logic to identify the request method, then return a response, all while skipping resolve(event). We only want to call resolve(event) when we want to Kit to find that route in our project.
PS: Next time it would be really helpful if you provided a link to a github repository or stackblitz workspace that reproduces the issue in a sveltekit project.
Describe the bug
When I make a CORS call on my API, I get the
Method Options not allowed
response status 405 and in the browser it will throw the 403 forbidden status.Reproduction
hook.server.ts
or thehooks/index.ts
prior to 1.0Logs
System Info
Severity
blocking an upgrade
Additional Information
In my old version using sveltekit version prior to 1.0, I don't get this issue. Here is the Response.
The text was updated successfully, but these errors were encountered: