Sha256: d99d55aa8170621e591f47661e5c7a1b4d35028397856ad0a3a1fb613ea5b7d0
Contents?: true
Size: 450 Bytes
Versions: 6
Compression:
Stored size: 450 Bytes
Contents
require "accept_headers" module AcceptHeaders class Middleware def initialize(app) @app = app end def call(env) env["accept_headers.media_types"] = MediaType::Negotiator.new(env["HTTP_ACCEPT"]) env["accept_headers.encodings"] = Encoding::Negotiator.new(env["HTTP_ACCEPT_ENCODING"]) env["accept_headers.languages"] = Language::Negotiator.new(env["HTTP_ACCEPT_LANGUAGE"]) @app.call(env) end end end
Version data entries
6 entries across 6 versions & 1 rubygems