Sha256: 188dd9bb6769e07c67ce72122430467d8b6b62b9f752bad637dee3d5e8a07026

Contents?: true

Size: 610 Bytes

Versions: 32

Compression:

Stored size: 610 Bytes

Contents

module ActionDispatch
  class BestStandardsSupport
    def initialize(app, type = true)
      @app = app

      @header = case type
      when true
        "IE=Edge,chrome=1"
      when :builtin
        "IE=Edge"
      when false
        nil
      end
    end

    def call(env)
      status, headers, body = @app.call(env)

      if headers["X-UA-Compatible"] && @header
        unless headers["X-UA-Compatible"][@header]
          headers["X-UA-Compatible"] << "," << @header.to_s
        end
      else
        headers["X-UA-Compatible"] = @header
      end

      [status, headers, body]
    end
  end
end

Version data entries

32 entries across 32 versions & 5 rubygems

Version Path
font-awesome-rails-3.1.1.2 vendor/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/best_standards_support.rb
font-awesome-rails-3.1.1.1 vendor/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/best_standards_support.rb
challah-1.0.0.beta3 vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/middleware/best_standards_support.rb
fc-webicons-0.0.4 vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/best_standards_support.rb
challah-1.0.0.beta2 vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/middleware/best_standards_support.rb
challah-1.0.0.beta vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/middleware/best_standards_support.rb
fc-webicons-0.0.3 vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/best_standards_support.rb
fc-webicons-0.0.2 vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/best_standards_support.rb
fc-webicons-0.0.1 vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_dispatch/middleware/best_standards_support.rb
actionpack-3.2.13 lib/action_dispatch/middleware/best_standards_support.rb
actionpack-3.2.13.rc2 lib/action_dispatch/middleware/best_standards_support.rb
actionpack-3.2.13.rc1 lib/action_dispatch/middleware/best_standards_support.rb