-
Notifications
You must be signed in to change notification settings - Fork 973
Do not reject UNKNOWN HttpMethod #6172
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
base: main
Are you sure you want to change the base?
Do not reject UNKNOWN HttpMethod #6172
Conversation
Also makes Tomcat use the METHOD header. Jetty already uses the METHOD header.
🔍 Build Scan® (commit: 59b48a1) |
jrhee17
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Direction looks good.
I'm not sure if you want to handle here as well, but client-side won't be able to send custom HTTP methods. We can keep this as a known issue and proceed with server-side first though
| // Set the method. | ||
| final HttpMethod method = req.method(); | ||
| coyoteReq.method().setString(method.name()); | ||
| coyoteReq.method().setString(req.headers().get(HttpHeaderNames.METHOD)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also add a integration test which validates the server can successfully process the custom http method?
jrhee17
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good to me once the CI is fixed 👍
One more note is the current approach is more of a workaround due to breaking changes - later we may allow registration of custom HttpMethods in a type-safe way when we bump the major version
| * | ||
| * @param additionalAllowedHttpMethods the additional allowed HTTP methods | ||
| */ | ||
| public ServerBuilder additionalAllowedHttpMethods(String... additionalAllowedHttpMethods) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
optional) for consistency with other APIs, it may be worth adding a additionalAllowedHttpMethods(Iterable<String>) variant
| // Set the method. | ||
| final HttpMethod method = req.method(); | ||
| coyoteReq.method().setString(method.name()); | ||
| coyoteReq.method().setString(req.headers().get(HttpHeaderNames.METHOD)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: I think it's fine to support just tomcat for now, and add support for jetty later if needed/reported
|
Gentle ping. We could also finish this implementation if you are busy @AlexProgrammerDE |
|
Hi, university started for me, so I'm a little more busy than usual. I'd appreciate if the team could finish this. |
Motivation:
Adds unknown HTTP Methods from other RFCs.
I need this feature because WebDav extends the list of HTTP Method names and
Http1RequestDecoderrejects unknown method names.More information in the Discord: https://canary.discord.com/channels/1087271586832318494/1087272728177942629/1351931184451686420
Modifications:
Result: