From 00cb14c6a4102a44c058cc1f5e12711ce4aa6e30 Mon Sep 17 00:00:00 2001 From: Arash Date: Mon, 22 Jul 2024 17:57:10 +0200 Subject: [PATCH] Refactor zipstream.py to use latin-1 encoding for archive name (The HTTP Header encoding must be latin-1) --- lib/galaxy/util/zipstream.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/util/zipstream.py b/lib/galaxy/util/zipstream.py index 5fa8bc0909b2..1cd1c77649e7 100644 --- a/lib/galaxy/util/zipstream.py +++ b/lib/galaxy/util/zipstream.py @@ -41,7 +41,7 @@ def response(self) -> Iterator[bytes]: def get_headers(self) -> Dict[str, str]: headers = {} if self.archive_name: - archive_name = self.archive_name.encode("utf-8", "replace").decode("latin-1") + archive_name = self.archive_name.encode("latin-1", "replace").decode("latin-1") headers["Content-Disposition"] = f'attachment; filename="{archive_name}.zip"' if self.upstream_mod_zip: headers["X-Archive-Files"] = "zip"