mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-05 04:54:04 -06:00
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
This commit is contained in:
parent
38b496102f
commit
7507ebad6a
1 changed files with 2 additions and 2 deletions
|
@ -1905,10 +1905,10 @@ class CuraApplication(QtApplication):
|
|||
# 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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue