summaryrefslogtreecommitdiffstats
path: root/lib/paperclip
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2020-09-27 22:00:43 +0200
committerGitHub <noreply@github.com>2020-09-27 22:00:43 +0200
commit5bbc9a4f78cce2ba519b061e77b166417b044235 (patch)
tree56611e2bd4950323d6b7f517b4ed108515d2258d /lib/paperclip
parentd60290044ed3f6f5cb84e1dafd317250d5c97d92 (diff)
Fix downloading remote media files when server returns empty filename (#14867)
Fixes #14817
Diffstat (limited to 'lib/paperclip')
-rw-r--r--lib/paperclip/response_with_limit_adapter.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/paperclip/response_with_limit_adapter.rb b/lib/paperclip/response_with_limit_adapter.rb
index 8711b13497a..17a2abd25f2 100644
--- a/lib/paperclip/response_with_limit_adapter.rb
+++ b/lib/paperclip/response_with_limit_adapter.rb
@@ -16,7 +16,7 @@ module Paperclip
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