-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Why does HTTP1 module lack support for certain request methods? #33699
Comments
In general, I believe the reason is that new HTTP methods can introduce new semantics, behavior, and/or parsing requirements in the protocol that the HTTP parser wouldn't be prepared for. |
These are pretty much all different methods from WebDAV extensions, except for M-SEARCH (UPnP), and PRI (an http/2 meta-method used for http/1 interop) |
It's much simpler and annoying than that... The original http-parser used a hard-coded list of supported methods for the sake of performance and expanding on that list was extremely difficult. It's been improved somewhat using the new parser written by @indutny but the legacy is still there. HTTP/2 (and eventually HTTP/3) don't suffer from that because how we handle header field values is significantly different. |
https://github.com/nodejs/llhttp Now that the HTTP parser used by nodejs is llhttp, should it be easy to support the new request method? |
It's just actually one word... It could be made so it can be custom, and on server you can also make it to handle custom word. No problems with all the words being written then. |
Will close this issue here given that nodejs/llhttp#61 has been opened. There's nothing more actionable here until that issue is resolved and llhttp is updated. |
node
v14.2.0
Linux localhost 4.9.148 #1 SMP PREEMPT Tue Mar 10 02:27:59 CST 2020 aarch64 Android
What steps will reproduce the bug?
Check the request methods supported by the http1 module.
Check the request methods supported by the http2 module.
Why does HTTP1 module lack support for certain request methods?
The HTTP1 module does not support the following request methods.
Another problem is that the HTTP2 module also lacks certain request methods supported in HTTP1.
Write the following files.
D:\Desktop\test.js
Use node to run it.
Then open http://localhost:8000/ in the google chrome browser.
Enter the following code in the browser console.
How often does it reproduce? Is there a required condition?
The probability of this problem occurring is 100%.
What is the expected behavior?
What do you see instead?
Additional information
The text was updated successfully, but these errors were encountered: