Sha256: 321d9a72ee09c109c0290f96d7c4507c2df127fde3971f6e5315c543cae2fe81
Contents?: true
Size: 455 Bytes
Versions: 6
Compression:
Stored size: 455 Bytes
Contents
require 'rack/mime' module Thumbs class ContentType def initialize(app, default_content_type = "image/jpeg") @app = app @default_content_type = default_content_type end def call(env) status, headers, body = @app.call(env) headers['Content-Type'] = Rack::Mime.mime_type(File.extname(env["thumbs.remote_url"]), @default_content_type) if headers['Content-Type'].nil? [status, headers, body] end end end
Version data entries
6 entries across 6 versions & 1 rubygems