Sha256: 12f93dac3a6839e1e3023e83dd56d1fb899569ea2e4eec2e1905e4d390e90971

Contents?: true

Size: 305 Bytes

Versions: 60

Compression:

Stored size: 305 Bytes

Contents

class Rack::App::Middlewares::HeaderSetter

  def initialize(app, headers)
    @app = app
    @headers = headers.freeze
  end

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

    @headers.each do |header, value|
      headers[header] ||= value
    end

    [status, headers, body]
  end

end

Version data entries

60 entries across 60 versions & 2 rubygems

Version Path
rack-app-6.1.0 lib/rack/app/middlewares/header_setter.rb
rack-app-6.0.0 lib/rack/app/middlewares/header_setter.rb
rack-app-5.12.0 lib/rack/app/middlewares/header_setter.rb
rack-app-5.11.1 lib/rack/app/middlewares/header_setter.rb
rack-app-5.11.0 lib/rack/app/middlewares/header_setter.rb
rack-app-5.10.2 lib/rack/app/middlewares/header_setter.rb
rack-app-5.10.1 lib/rack/app/middlewares/header_setter.rb
rack-app-5.10.0 lib/rack/app/middlewares/header_setter.rb
rack-app-5.9.0 lib/rack/app/middlewares/header_setter.rb
rack-app-5.8.0 lib/rack/app/middlewares/header_setter.rb
rack-app-5.7.0 lib/rack/app/middlewares/header_setter.rb
rack-app-5.7.0.rc lib/rack/app/middlewares/header_setter.rb
rack-app-5.6.0 lib/rack/app/middlewares/header_setter.rb
rack-app-5.5.1 lib/rack/app/middlewares/header_setter.rb
rack-app-5.4.0 lib/rack/app/middlewares/header_setter.rb
rack-app-5.3.2 lib/rack/app/middlewares/header_setter.rb
rack-app-5.3.1 lib/rack/app/middlewares/header_setter.rb
rack-app-5.3.0 lib/rack/app/middlewares/header_setter.rb
rack-app-5.2.0 lib/rack/app/middlewares/header_setter.rb
rack-app-5.1.0 lib/rack/app/middlewares/header_setter.rb