fix conversion of old flows failing due to missing array keys

This commit is contained in:
r00t 2021-01-25 16:27:33 +01:00
parent a793a6256a
commit 9af41b7f72

View File

@ -174,19 +174,22 @@ def convert_6_7(data):
def convert_7_8(data): def convert_7_8(data):
data["version"] = 8 data["version"] = 8
if "request" in data and data["request"] is not None:
data["request"]["trailers"] = None data["request"]["trailers"] = None
if data["response"] is not None: if "response" in data and data["response"] is not None:
data["response"]["trailers"] = None data["response"]["trailers"] = None
return data return data
def convert_8_9(data): def convert_8_9(data):
data["version"] = 9 data["version"] = 9
is_request_replay = False
if "request" in data:
data["request"].pop("first_line_format") data["request"].pop("first_line_format")
data["request"]["authority"] = b"" data["request"]["authority"] = b""
is_request_replay = data["request"].pop("is_replay", False) is_request_replay = data["request"].pop("is_replay", False)
is_response_replay = False is_response_replay = False
if data["response"] is not None: if "response" in data and data["response"] is not None:
is_response_replay = data["response"].pop("is_replay", False) is_response_replay = data["response"].pop("is_replay", False)
if is_request_replay: # pragma: no cover if is_request_replay: # pragma: no cover
data["is_replay"] = "request" data["is_replay"] = "request"