Class: Fly::Headers

Inherits:
Object
  • Object
show all
Defined in:
lib/fly-ruby/headers.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Headers

Returns a new instance of Headers.



5
6
7
# File 'lib/fly-ruby/headers.rb', line 5

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



9
10
11
12
13
14
# File 'lib/fly-ruby/headers.rb', line 9

def call(env)
  status, headers, body = @app.call(env)
  response = Rack::Response.new(body, status, headers)
  response.set_header('Fly-Region', ENV['FLY_REGION'])
  response.finish
end