download_strategy: add another presence check.

This commit is contained in:
Mike McQuaid 2023-03-08 12:49:25 +00:00 committed by GitHub
parent 160e7da779
commit 97b66d3ae7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -487,7 +487,7 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy
# content-disposition: attachment; filename="myapp-1.2.3.pkg"; filename*=UTF-8''"myapp-1.2.3.pkg" # content-disposition: attachment; filename="myapp-1.2.3.pkg"; filename*=UTF-8''"myapp-1.2.3.pkg"
# Then the encoded_filename will come back as the empty string, in which case we should fall back to the # Then the encoded_filename will come back as the empty string, in which case we should fall back to the
# `filename` parameter. # `filename` parameter.
if encoding && encoded_filename.present? if encoding.present? && encoded_filename.present?
filename = URI.decode_www_form_component(encoded_filename).encode(encoding) filename = URI.decode_www_form_component(encoded_filename).encode(encoding)
end end
end end