From 7507ebad6ab41120f90ad434ce25914cd7e89464 Mon Sep 17 00:00:00 2001 From: "c.lamboo" Date: Tue, 12 Nov 2024 23:09:23 +0100 Subject: [PATCH] Fix for url-schemes with quotes Last quote would not be matched due to the optional last quote in the regex, resulting in an `.stl"` extension CURA-12282 --- cura/CuraApplication.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 94f6a17f97e..97c4c7e2fcc 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -1905,10 +1905,10 @@ def on_finish(response): # Use a regex to extract the filename content_disposition = str(response.rawHeader(content_disposition_header_key).data(), encoding='utf-8') - content_disposition_match = re.match(r'attachment; filename="?(?P.*)"?', + content_disposition_match = re.match(r'attachment; filename=(?P.*)', content_disposition) if content_disposition_match is not None: - filename = content_disposition_match.group("filename") + filename = content_disposition_match.group("filename").strip("\"") tmp = tempfile.NamedTemporaryFile(suffix=filename, delete=False) with open(tmp.name, "wb") as f: