Respect HTTP request method casing#2274
Open
karenetheridge wants to merge 1 commit intomojolicious:mainfrom
Open
Respect HTTP request method casing#2274karenetheridge wants to merge 1 commit intomojolicious:mainfrom
karenetheridge wants to merge 1 commit intomojolicious:mainfrom
Conversation
34c5b7e to
8214d7f
Compare
Contributor
Author
|
I think I've got everything now. I recognize that this is may be controversial, but even as a breaking change I think it's the right thing to do. |
While weird, mixed-case or lower-cased methods are totally legal, and some symbols are permitted too. The ABNF is here: https://www.rfc-editor.org/rfc/rfc9110#appendix-A
8214d7f to
41a0a6b
Compare
Member
|
Yes, this does seem a little controversial to me, but we can put it up to a vote. |
There was a problem hiding this comment.
Pull Request Overview
This PR modifies Mojolicious to respect HTTP request method casing instead of automatically converting methods to uppercase. The change ensures that mixed-case or lowercase HTTP methods (which are valid according to RFC 9110) are preserved throughout the framework.
- Remove automatic uppercase conversion of HTTP methods in routing and processing
- Update test cases to use proper casing or test lowercase method handling
- Preserve method casing in debug output and command-line tools
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/Mojolicious/Routes/Route.pm | Remove uppercase conversion in methods() function |
| lib/Mojolicious/Routes.pm | Preserve method casing in routing logic |
| lib/Mojo/UserAgent/Transactor.pm | Remove uppercase conversion in proxy and redirect handling |
| lib/Mojo/UserAgent.pm | Remove uppercase conversion in connection reuse logic |
| lib/Mojo/Transaction/HTTP.pm | Remove uppercase conversion in HEAD request handling |
| lib/Mojo/Message/Request.pm | Remove uppercase conversion in request line generation |
| lib/Test/Mojo.pm | Preserve method casing in test descriptions |
| lib/Mojolicious/Command/routes.pm | Remove uppercase conversion in routes command output |
| lib/Mojolicious/resources/templates/mojo/debug.html.ep | Remove uppercase conversion in debug template |
| t/mojolicious/routes.t | Update test methods to use uppercase for consistency |
| t/mojolicious/lite_app.t | Update test methods and add lowercase method test case |
| t/mojo/transactor.t | Update test descriptions and methods to reflect new behavior |
| t/mojo/request.t | Add test for method case preservation and update existing tests |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While weird, mixed-case or lower-cased methods are totally legal, and some symbols are permitted too.
The ABNF is here: https://www.rfc-editor.org/rfc/rfc9110#appendix-A