Cannot modify HTTP/2 responses
See original GitHub issueSteps to reproduce the problem:
Perhaps I’m missing something here, but I cannot seem to modify HTTP/2 responses. HTTP/1.1 works fine. The following script breaks when the browser attempts to use HTTP/2:
def response(flow):
flow.response.headers['X-Filtered'] = 'true'
Invoked with mitmproxy -T --host -s script.py
.
Any other comments? What have you tried so far?
If I additionally add --no-http2
, the script works correctly. If the browser does not use HTTP/2, everything also works as expected.
System information
Mitmproxy version: 2.0.1 (release version) Precompiled Binary
Python version: 3.5.2
Platform: Linux-3.16.0-4-amd64-x86_64-with-debian-8.7
SSL version: OpenSSL 1.1.0e 16 Feb 2017
Linux distro: debian 8.7
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Unable to make http2 requests to an Apache Server, though ...
In the address bar of Firefox, type "about:config", then search for "network.http.spdy.enabled.http2" and make sure that it is set to true.
Read more >HTTP response status codes - MDN Web Docs - Mozilla
HTTP response status codes indicate whether a specific HTTP request has been successfully completed. Responses are grouped in five classes:
Read more >HTTP/2 Frequently Asked Questions
Servers that don't wish to process the HTTP/1.1 response should reject stream 1 with a REFUSED_STREAM error code immediately after sending the connection ......
Read more >Introduction to HTTP/2 - web.dev
HTTP/2 does not modify the application semantics of HTTP in any way. All the core concepts, such as HTTP methods, status codes, URIs,...
Read more >Updating HTTP responses in origin response triggers
Use Lambda@Edge to modify HTTP responses from the origin before forwarding them on to viewers.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Can you be more specific regarding “breaks”? Does it work if you specify the header name as lowercase?
This should be fixed already in git-master: https://github.com/mitmproxy/mitmproxy/pull/2055/files