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
actionpack-3.2.22.5 lib/action_dispatch/middleware/best_standards_support.rb
actionpack-3.2.22.4 lib/action_dispatch/middleware/best_standards_support.rb
actionpack-3.2.22.3 lib/action_dispatch/middleware/best_standards_support.rb
actionpack-3.2.22.2 lib/action_dispatch/middleware/best_standards_support.rb
actionpack-3.2.22.1 lib/action_dispatch/middleware/best_standards_support.rb
actionpack-3.2.22 lib/action_dispatch/middleware/best_standards_support.rb
actionpack-3.2.21 lib/action_dispatch/middleware/best_standards_support.rb
actionpack-3.2.20 lib/action_dispatch/middleware/best_standards_support.rb
actionpack-3.2.19 lib/action_dispatch/middleware/best_standards_support.rb
actionpack-3.2.18 lib/action_dispatch/middleware/best_standards_support.rb
actionpack-3.2.17 lib/action_dispatch/middleware/best_standards_support.rb
actionpack-3.2.16 lib/action_dispatch/middleware/best_standards_support.rb
actionpack-3.2.15 lib/action_dispatch/middleware/best_standards_support.rb
actionpack-3.2.15.rc3 lib/action_dispatch/middleware/best_standards_support.rb
actionpack-3.2.15.rc2 lib/action_dispatch/middleware/best_standards_support.rb
actionpack-3.2.15.rc1 lib/action_dispatch/middleware/best_standards_support.rb
actionpack-3.2.14 lib/action_dispatch/middleware/best_standards_support.rb
actionpack-3.2.14.rc2 lib/action_dispatch/middleware/best_standards_support.rb
actionpack-3.2.14.rc1 lib/action_dispatch/middleware/best_standards_support.rb
swipe-rails-0.0.5 vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/middleware/best_standards_support.rb