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-7.3.2 lib/rack/app/middlewares/header_setter.rb
rack-app-7.3.1 lib/rack/app/middlewares/header_setter.rb
rack-app-7.3.0 lib/rack/app/middlewares/header_setter.rb
rack-app-7.2.2 lib/rack/app/middlewares/header_setter.rb
rack-app-7.2.1 lib/rack/app/middlewares/header_setter.rb
rack-app-7.2.0 lib/rack/app/middlewares/header_setter.rb
rack-app-7.1.0 lib/rack/app/middlewares/header_setter.rb
rack-app-7.0.0 lib/rack/app/middlewares/header_setter.rb
rack-app-6.8.0 lib/rack/app/middlewares/header_setter.rb
rack-app-6.7.1 lib/rack/app/middlewares/header_setter.rb
rack-app-6.7.0 lib/rack/app/middlewares/header_setter.rb
rack-app-6.6.0 lib/rack/app/middlewares/header_setter.rb
rack-app-6.5.0 lib/rack/app/middlewares/header_setter.rb
rack-app-6.4.1 lib/rack/app/middlewares/header_setter.rb
rack-app-6.4.0 lib/rack/app/middlewares/header_setter.rb
rack-app-6.3.3 lib/rack/app/middlewares/header_setter.rb
rack-app-6.3.2 lib/rack/app/middlewares/header_setter.rb
rack-app-6.3.1 lib/rack/app/middlewares/header_setter.rb
rack-app-6.3.0 lib/rack/app/middlewares/header_setter.rb
rack-app-6.2.0 lib/rack/app/middlewares/header_setter.rb