class Paperclip::Storage::Redis::App

Public Instance Methods

call(env) click to toggle source
# File lib/paperclip/storage/redis.rb, line 61
def call(env)
        content = ::Redis.new.get(env["PATH_INFO"].gsub(/^\//, ""))
        extname = File.extname(env["PATH_INFO"])[1..-1]
        content_type = Mime::Type.lookup_by_extension(extname)
        begin
                [200, {"Content-Type" => content_type.to_s, "Content-Length" => content.bytesize.to_s}, [content]]
        rescue
                #raise $!
                [404, {}, []]
        end
end