Skip to content

Commit

Permalink
Fix downloading remote media files when server returns empty filename (
Browse files Browse the repository at this point in the history
  • Loading branch information
ClearlyClaire committed Dec 18, 2020
1 parent c5bb995 commit 74afab1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/paperclip/response_with_limit_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def initialize(target, options = {})
private

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
@tempfile = copy_to_tempfile(@target)
@content_type = ContentTypeDetector.new(@tempfile.path).detect
Expand Down

0 comments on commit 74afab1

Please sign in to comment.