-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
HEAD reported as an invalid request handler #9468
Comments
The error is correct, |
No, it doesn't throw an error during build, nor when invoked during dev. |
If I create a |
Transfering to the SvelteKit - it shouldn't happen that HEAD is somehow called IMO. Could you provide a minimum reproducible where HEAD is called? |
Then the question is: Why isn't (this issue discusses the HEAD verb as if nothing strange about it?!: #9164) |
The current logic seems to allow for any exported endpoint to be called as long as it matches the request method name. kit/packages/kit/src/runtime/server/endpoint.js Lines 11 to 22 in c0612a8
I think the exported endpoint is only validated when a +page co-exists with the +server.js file. kit/packages/kit/src/runtime/server/respond.js Lines 366 to 367 in c0612a8
and even then it seems as if it would return true in most cases after negotiating the content type kit/packages/kit/src/runtime/server/endpoint.js Lines 72 to 86 in c0612a8
|
Giving this the enhancement label - I think we should add official support for having a |
Describe the bug
VS Code is reporting exporting a
HEAD
request handler with the following error:The
HEAD
handler is properly called when aHEAD
request is issued, andsvelte-check
doesn't complain about it either, so my guess is that this is an error related to the language tools.I also noted that
HEAD
is not listed as a valid verb at the documentation (https://kit.svelte.dev/docs/routing#server)Reproduction
Expected behaviour
I don't expect an error here
System Info
Version: 1.76.2
Commit: ee2b180d582a7f601fa6ecfdad8d9fd269ab1884
Date: 2023-03-14T17:54:09.061Z
Electron: 19.1.11
Chromium: 102.0.5005.196
Node.js: 16.14.2
V8: 10.2.154.26-electron.0
OS: Darwin x64 22.1.0
Sandboxed: Yes
Which package is the issue about?
Svelte for VS Code extension
Additional Information, eg. Screenshots
No response
The text was updated successfully, but these errors were encountered: