Commit 96d0b1c6 authored by Alexis Reigel's avatar Alexis Reigel Committed by Alexis Reigel

require uploaded file's name to match in any case

parent 256d9597
...@@ -31,13 +31,17 @@ module UploadsActions ...@@ -31,13 +31,17 @@ module UploadsActions
disposition = uploader.image_or_video? ? 'inline' : 'attachment' disposition = uploader.image_or_video? ? 'inline' : 'attachment'
if uploader.filename == params[:filename]
return send_upload(uploader, attachment: uploader.filename, disposition: disposition)
end
uploader_version = uploader.versions.values.find { |version| version.filename == params[:filename] } uploader_version = uploader.versions.values.find { |version| version.filename == params[:filename] }
if uploader_version if uploader_version
return send_upload(uploader_version, attachment: uploader_version.filename, disposition: disposition) return send_upload(uploader_version, attachment: uploader_version.filename, disposition: disposition)
end end
return send_upload(uploader, attachment: uploader.filename, disposition: disposition) render_404
end end
private private
......
This diff is collapsed.
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