mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-06-30 04:05:25 +08: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
@ -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…
x
Reference in New Issue
Block a user