download_strategy: only take basename of Content-Disposition

This commit is contained in:
Bo Anderson 2021-02-27 17:54:18 +00:00
parent a466e6152a
commit 388a66383b
No known key found for this signature in database
GPG Key ID: 3DB94E204E137D65

View File

@ -458,7 +458,7 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy
filename = URI.decode_www_form_component(encoded_filename).encode(encoding) if encoding && encoded_filename filename = URI.decode_www_form_component(encoded_filename).encode(encoding) if encoding && encoded_filename
end end
filename || content_disposition.filename (filename || content_disposition.filename).rpartition("/")[-1]
end end
filenames = lines.map(&parse_content_disposition).compact filenames = lines.map(&parse_content_disposition).compact