From 68bcc82b8e4c219b024bff0081741c799b9cbd74 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Tue, 2 Feb 2016 15:49:21 +0100 Subject: [PATCH] do not send RST if there is not upstream stream openend yet --- libmproxy/protocol/http2.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libmproxy/protocol/http2.py b/libmproxy/protocol/http2.py index 4b3ef0ed4..fe9f86951 100644 --- a/libmproxy/protocol/http2.py +++ b/libmproxy/protocol/http2.py @@ -161,7 +161,8 @@ class Http2Layer(Layer): other_stream_id = self.streams[eid].client_stream_id else: other_stream_id = self.streams[eid].server_stream_id - other_conn.h2.safe_reset_stream(other_stream_id, event.error_code) + if other_stream_id is not None: + other_conn.h2.safe_reset_stream(other_stream_id, event.error_code) elif isinstance(event, RemoteSettingsChanged): new_settings = dict([(id, cs.new_value) for (id, cs) in event.changed_settings.iteritems()]) other_conn.h2.safe_update_settings(new_settings)