While reviewing issue #34044, I noticed that the HttpMethod class does not include a constant for the HTTP method CONNECT, which was introduced in RFC 7231. This PR adds the CONNECT constant to the HttpMethod class and updates the test class HttpMethodTests.
Changes in other files:
-
CONNECT method excluded in initAllowedHttpMethods of RequestMappingInfoHandlerMapping and in initAllowHeader of WebContentGenerator.
-
CONNECT method is not supported by HttpComponentsClientHttpConnector and JdkClientHttpConnector, so ClientHttpConnectorTests was updated to dynamically skip CONNECT for these connectors.
-
CONNECT method is primarily used for establishing tunnels, so it is not relevant for RequestMethod class and was excluded from RequestMethodTests.
These changes prepare the repository for a follow-up PR addressing issue #34044, where a conditional check will be introduced for WebSocket handshakes: if the HTTP version is HTTP/2 the method must be CONNECT, as specified in RFC 8441, otherwise it should be GET.
Comment From: snicoll
Additionally the documentation references for existing constants in HttpMethod have been updated to point to the RFC 9110, as the previous links referenced a superseded document.
Please revert, this is unrelated to your proposal of adding CONNECT
.
Comment From: v-perfilev
Hello @snicoll !
Done: the commit with link updates has been reverted as requested.
- Would you like me to create a separate PR for this change, or should I leave it for now?
- Do the same 55-character length rule apply to revert commit messages?
Comment From: snicoll
Let's see where this PR leads us and we can revisit the other change. The rule (not sure where that comes from) is irrelevant as your commits are going to be squashed if we merge this.
Comment From: v-perfilev
@snicoll Okay, I got it. This rule comes from CONTRIBUTING.md:
Format commit messages using 55 characters for the subject line, 72 characters per line for the description.