Sha256: e075a094ada43a6c1a53de87d21951f5bfb921e767fea4ae6bc04a27156ad20e

Contents?: true

Size: 439 Bytes

Versions: 3

Compression:

Stored size: 439 Bytes

Contents

# encoding: utf-8

module Hyperdrive
  module Middleware
    class Charset
      def initialize(app)
        @app = app
      end

      def call(env)
        unless %w(OPTIONS TRACE).include? env['REQUEST_METHOD']
          charset = Rack::Accept::Charset.new(env['HTTP_ACCEPT_CHARSET'] || '*')
          Hyperdrive::Utils.enforce_charset!(charset, env['hyperdrive.params'])
        end
        @app.call(env)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hyperdrive-0.0.25 lib/hyperdrive/middleware/charset.rb
hyperdrive-0.0.24 lib/hyperdrive/middleware/charset.rb
hyperdrive-0.0.23 lib/hyperdrive/middleware/charset.rb