aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Kriechbaumer <thomas@kriechbaumer.name>2016-05-21 21:45:36 +0200
committerThomas Kriechbaumer <thomas@kriechbaumer.name>2016-05-21 21:45:36 +0200
commite6c2e012a5df3bbc4fc13e3fe1048976bda48ed8 (patch)
treefc6296ce0faf45a8159c6666e8a8626b5d43460e
parented4c99b33ae7f09c1359bc5af0a2c121a44bb9a8 (diff)
downloadmitmproxy-e6c2e012a5df3bbc4fc13e3fe1048976bda48ed8.tar.gz
mitmproxy-e6c2e012a5df3bbc4fc13e3fe1048976bda48ed8.tar.bz2
mitmproxy-e6c2e012a5df3bbc4fc13e3fe1048976bda48ed8.zip
fix weight value serialization
-rw-r--r--mitmproxy/protocol/http2.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/mitmproxy/protocol/http2.py b/mitmproxy/protocol/http2.py
index 98728c8a..30763c66 100644
--- a/mitmproxy/protocol/http2.py
+++ b/mitmproxy/protocol/http2.py
@@ -195,7 +195,8 @@ class Http2Layer(Layer):
if depends_on in self.streams.keys() and self.streams[depends_on].server_stream_id:
depends_on = self.streams[depends_on].server_stream_id
- frame = PriorityFrame(stream_id, depends_on, event.weight, event.exclusive)
+ # weight is between 1 and 256 (inclusive), but represented as uint8 (0 to 255)
+ frame = PriorityFrame(stream_id, depends_on, event.weight - 1, event.exclusive)
self.server_conn.send(frame.serialize())
elif isinstance(event, events.TrailersReceived):
raise NotImplementedError()