Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Ignore invalid Content-Disposition header #2284

Merged
merged 2 commits into from Aug 24, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/paperclip/io_adapters/uri_adapter.rb
Expand Up @@ -29,8 +29,9 @@ def content_type_from_content

def filename_from_content_disposition
if @content.meta.has_key?("content-disposition")
@content.meta["content-disposition"].
match(/filename="([^"]*)"/)[1]
matches = @content.meta["content-disposition"].
match(/filename="([^"]*)"/)
matches[1] if matches
end
end

Expand Down