Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions utils/proxy/_deserializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,12 @@ def json_load():
item["content"] = json.loads(part.content)

elif content_type_part == "application/gzip":
with gzip.GzipFile(fileobj=io.BytesIO(part.content)) as gz_file:
content = gz_file.read()
try:
with gzip.GzipFile(fileobj=io.BytesIO(part.content)) as gz_file:
content = gz_file.read()
except:
item["system-tests-error"] = "Can't decompress gzip data"
continue

_deserialize_file_in_multipart_form_data(item, headers, export_content_files_to, content)

Expand Down Expand Up @@ -239,6 +243,8 @@ def _deserialize_file_in_multipart_form_data(
item["system-tests-error"] = "Filename not found in content-disposition, please contact #apm-shared-testing"
else:
filename = meta_data["filename"].strip('"')
if filename.lower().endswith(".gz"):
filename = filename[:-3]
file_path = f"{export_content_files_to}/{md5(content).hexdigest()}_{filename}"

with open(file_path, "wb") as f:
Expand Down
Loading