[go: up one dir, main page]

Skip to content
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

http_version return HTTP/2 as HTTP/2.0 #7124

Open
HongYang01 opened this issue Aug 22, 2024 · 2 comments
Open

http_version return HTTP/2 as HTTP/2.0 #7124

HongYang01 opened this issue Aug 22, 2024 · 2 comments

Comments

@HongYang01
Copy link

Problem Description

Hi, I'm not sure about this, but http_version returns HTTP/2 as HTTP/2.0 which is not the standard protocol naming.

Code Reference:

https://github.com/mitmproxy/mitmproxy/blob/332f222994deb27bb0ab68618b23f270b3bdfe2d/mitmproxy/http.py#L263C5-L263C35

@mhils
Copy link
Member
mhils commented Aug 22, 2024

If you want to check if a particular request is done over HTTP/2, I'd recommend to use the is_http2 property:
https://docs.mitmproxy.org/stable/api/mitmproxy/http.html#Message.is_http2

It's true that the protocol is commonly referred to as HTTP/2 and not HTTP/2.0. At the same time, I don't think you can argue that either is wrong. If you look at the RFC, you see that it only really defines "h2":
https://datatracker.ietf.org/doc/html/rfc9113#name-http-2-version-identificati
and that the preamble uses in fact "HTTP/2.0":
https://datatracker.ietf.org/doc/html/rfc9113#section-3.4

That being said, considering we use HTTP/3 for HTTP/3, I guess I'd be willing to merge a PR that changes it to HTTP/2 everywhere. :)

@HongYang01
Copy link
Author

Aite, sure @mhils. I'll do a PR anytime soon.

FYI, while HTTP/2 was initially developed under the working title of HTTP/2.0, the final, official name adopted after the standardization process was simply HTTP/2.

p.s. h2 is an abbreviation of HTTP/2 stated in the document.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants