Fix downloading remote media files when server returns empty filename (#14867)

Fixes #14817
lolsob-rspec
ThibG 2020-09-27 22:00:43 +02:00 committed by GitHub
parent 1603dc87ac
commit ab58e4a090
1 changed files with 1 additions and 1 deletions

View File

@ -16,7 +16,7 @@ module Paperclip
private private
def cache_current_values def cache_current_values
@original_filename = filename_from_content_disposition || filename_from_path || 'data' @original_filename = filename_from_content_disposition.presence || filename_from_path.presence || 'data'
@size = @target.response.content_length @size = @target.response.content_length
@tempfile = copy_to_tempfile(@target) @tempfile = copy_to_tempfile(@target)
@content_type = ContentTypeDetector.new(@tempfile.path).detect @content_type = ContentTypeDetector.new(@tempfile.path).detect