Skip to content

Commit

Permalink
Fix for url-schemes with quotes
Browse files Browse the repository at this point in the history
Last quote would not be matched due to the optional last quote in the regex, resulting in an `.stl"` extension

CURA-12282
  • Loading branch information
casperlamboo committed Nov 12, 2024
1 parent 38b4961 commit 7507eba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cura/CuraApplication.py
Original file line number Diff line number Diff line change
Expand Up @@ -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<filename>.*)"?',
content_disposition_match = re.match(r'attachment; filename=(?P<filename>.*)',
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:
Expand Down

0 comments on commit 7507eba

Please sign in to comment.