Class: FlowmorRouter::HostAndPortGrabber

Inherits:
Object
  • Object
show all
Defined in:
lib/flowmor_router.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ HostAndPortGrabber

Returns a new instance of HostAndPortGrabber.



9
10
11
# File 'lib/flowmor_router.rb', line 9

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/flowmor_router.rb', line 13

def call(env)
  req = Rack::Request.new(env)
  Thread.current[:host] = req.host
  Thread.current[:port] = req.port
  
  @app.call(env)
end