Show HTTP reason phrases for HTTP/2 and HTTP/3 via lookup table (issue #7694) - #8424
Larslllllll wants to merge 3 commits into
Conversation
…mitmproxy#7694) Adds statusCodeReasons lookup table (auto-generated from status_codes.py) and uses it in HttpMessages ResponseLine to show reason phrases for HTTP/2 and HTTP/3 responses. These are looked up from the status code since HTTP/2 and HTTP/3 do not transmit reason phrases on the wire. Includes a title tooltip explaining this.
|
I fetched the PR head at |
|
Correction: I could not add inline comments because GitHub's review endpoint was unavailable. The issues I found are at lines 18 and 70; both are described above, but there are no inline review comments. |
Summary
Show reason phrases for HTTP/2 and HTTP/3 responses in the mitmweb flow view by looking them up from a status code table. These are not transmitted on the wire per RFC 7540 (HTTP/2) and RFC 9113 (HTTP/3), so a lookup table provides the human-readable reason.
Changes
web/gen/status_codes.py: A Python script that convertsmitmproxy/net/http/status_codes.pyto a TypeScript status code → reason phrase mapping.web/src/js/statusCodes.ts: Generated TypeScript file withexport const statusCodeReasons: Record<number, string>.web/src/js/components/FlowView/HttpMessages.tsx:statusCodeReasonsResponseLineto show looked-up reason for HTTP/2 and HTTP/3Details
statusCodeReasons[status_code]since the wire format omits it.Testing
Closes the RFC task from #7694.
Co-authored-by: web/gen/status_codes.py