-
Notifications
You must be signed in to change notification settings - Fork 583
Respect HTTP request method casing #2274
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?
Respect HTTP request method casing #2274
Conversation
34c5b7e
to
8214d7f
Compare
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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