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-11.0.2 lib/rack/app/middlewares/header_setter.rb
rack-app-11.0.1 lib/rack/app/middlewares/header_setter.rb
rack-app-11.0.0 lib/rack/app/middlewares/header_setter.rb
rack-app-10.0.0 lib/rack/app/middlewares/header_setter.rb
rack-app-9.0.0 lib/rack/app/middlewares/header_setter.rb
rack-app-8.1.0 lib/rack/app/middlewares/header_setter.rb
rack-app-8.0.1 lib/rack/app/middlewares/header_setter.rb
rack-app-8.0.0 lib/rack/app/middlewares/header_setter.rb
mountapi-0.11.1 vendor/bundle/ruby/2.7.0/gems/rack-app-7.7.0/lib/rack/app/middlewares/header_setter.rb
rack-app-7.7.0 lib/rack/app/middlewares/header_setter.rb
rack-app-7.6.5 lib/rack/app/middlewares/header_setter.rb
rack-app-7.6.4 lib/rack/app/middlewares/header_setter.rb
rack-app-7.6.3 lib/rack/app/middlewares/header_setter.rb
rack-app-7.6.2 lib/rack/app/middlewares/header_setter.rb
rack-app-7.6.1 lib/rack/app/middlewares/header_setter.rb
rack-app-7.6.0 lib/rack/app/middlewares/header_setter.rb
rack-app-7.5.2 lib/rack/app/middlewares/header_setter.rb
rack-app-7.5.1 lib/rack/app/middlewares/header_setter.rb
rack-app-7.5.0 lib/rack/app/middlewares/header_setter.rb
rack-app-7.4.0 lib/rack/app/middlewares/header_setter.rb