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

Backport Invalid Content-Disposition header fix to v4.3 #2478

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions NEWS
@@ -1,3 +1,7 @@
4.3.8 (8/23/2017):

* Bug Fix: Backport "Ignore invalid content-disposition header (#2284)" to 4.3

4.3.7 (7/1/2016):

* Add deprecation warnings
Expand Down
5 changes: 3 additions & 2 deletions lib/paperclip/io_adapters/uri_adapter.rb
Expand Up @@ -30,8 +30,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
2 changes: 1 addition & 1 deletion lib/paperclip/version.rb
@@ -1,3 +1,3 @@
module Paperclip
VERSION = "4.3.7".freeze unless defined? Paperclip::VERSION
VERSION = "4.3.8".freeze unless defined? Paperclip::VERSION
end