Do not capitalize method value. It causes confusion when editing requ… by gachikuku · Pull Request #7808 · mitmproxy/mitmproxy
Description
Do not capitalize HTTP methods after editing.
It causes confusion and it's not reflecting the true state of the request being sent.
Checklist
- I have added an entry to the CHANGELOG.
- I have updated tests where applicable.
It causes confusion and it's not reflecting the true state of the request being sent.
Hi, could you elaborate more on this with more details? thanks! At first glance, it doesn't make sense to me to remove the .upper().
Sorry, but I still don't get where the problem is. Could you write down the exact steps to reproduce the issue? Thanks :)
Sure! Sorry if I was not clear
- Pick a request and change the HTTP method to anything.
For example fromGETtopost. - After editing, the request from
GETtopost,
the method or verb gets displayed asPOSTNOTpost. - It should have been displayed as
postsince we changed it topostnotPOST. - After exporting the
raw_requestonly therepostis displayed instead ofPOST.
I find out only after I exported the raw_request and saw what was actually happening.
Please don't hesitate to ask me for further clarification, and thank you in advance.
Maybe is a console issue? I don't know but when I deleted .upper()
then the HTTP method was displayed with the correct capitalization.
Ah, I see now. Yes, there is some confusion when we export the raw content. Maybe we should just stick with the uppercase version there as well. As far as I’ve seen, the request method is always displayed in uppercase.
Exactly, the request method is always displayed in uppercase, but it's not actually whats being send if the user types the method with lowercase
Let the user decide the letter case :)
Okay I am fine with that! Then you should just fix the tests :) let's see if also @mhils and @Prinzhorn agree with this approach!
There are a lot of comparisons in the codebase that involve method.
It would be a good idea to validate which of them might need to call .upper for those comparisons.
@mheguy I wouldn't mind if you want to do that!
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
