diff options
author | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2015-09-02 20:50:50 +0200 |
---|---|---|
committer | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2015-09-02 20:50:50 +0200 |
commit | c79af6276340decd34730069614d6cac9283a822 (patch) | |
tree | 614c64d7b0aa9d547793279076aa0dfbc0b49e2d /libmproxy/protocol | |
parent | c14fbc7794eee2a60d3c90f818ec481cf9db544b (diff) | |
download | mitmproxy-c79af6276340decd34730069614d6cac9283a822.tar.gz mitmproxy-c79af6276340decd34730069614d6cac9283a822.tar.bz2 mitmproxy-c79af6276340decd34730069614d6cac9283a822.zip |
ignore http2 priority frames
Diffstat (limited to 'libmproxy/protocol')
-rw-r--r-- | libmproxy/protocol/http.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libmproxy/protocol/http.py b/libmproxy/protocol/http.py index 7f57d17c..4be1f762 100644 --- a/libmproxy/protocol/http.py +++ b/libmproxy/protocol/http.py @@ -7,7 +7,7 @@ from netlib import odict from netlib.tcp import NetLibError, Address from netlib.http.http1 import HTTP1Protocol from netlib.http.http2 import HTTP2Protocol -from netlib.http.http2.frame import WindowUpdateFrame +from netlib.http.http2.frame import PriorityFrame, WindowUpdateFrame from .. import utils from ..exceptions import InvalidCredentials, HttpException, ProtocolException @@ -196,6 +196,13 @@ class Http2Layer(_HttpLayer): # Ideally we should keep track of our own flow control window and # stall transmission if the outgoing flow control buffer is full. return + if isinstance(frame, PriorityFrame): + # Clients are sending Priority frames depending on their implementation. + # The RFC does not clearly state when or which priority preferences should be set. + # Since we cannot predict these frames, and we do not need to respond to them, + # simply accept them, and hide them from the log. + # Ideally we should forward them to the server. + return self.log("Unexpected HTTP2 Frame: %s" % frame.human_readable(), "info") |