Commit 3155cd7e by Hasan Kumar Committed by Mike Burns

Ignore empty filename from content-disposition

e.g., the way google stores its user profile photos (from their oauth2 API)
https://lh3.googleusercontent.com/-aRHQV4YjnBM/AAAAAAAAAAI/AAAAAAAAAAo/ngSjy9-yR5c/photo.jpg
parent 84d54dac
...@@ -36,7 +36,7 @@ module Paperclip ...@@ -36,7 +36,7 @@ module Paperclip
def filename_from_content_disposition def filename_from_content_disposition
if @content.meta.key?("content-disposition") if @content.meta.key?("content-disposition")
matches = @content.meta["content-disposition"].match(/filename="([^"]*)"/) matches = @content.meta["content-disposition"].match(/filename="([^"]*)"/)
matches[1] if matches matches[1].presence if matches
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment