Merge pull request #10728 from Bo98/content-disposition-basename

download_strategy: only take basename of Content-Disposition
This commit is contained in:
Bo Anderson 2021-02-27 18:42:23 +00:00 committed by GitHub
commit 7ab7ace64e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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