Method: Sinatra::Base#forward

Defined in:
lib/sinatra/base.rb

#forwardObject

Forward the request to the downstream app -- middleware only.

[View source]

1043
1044
1045
1046
1047
1048
1049
1050
1051
# File 'lib/sinatra/base.rb', line 1043

def forward
  raise 'downstream app not set' unless @app.respond_to? :call

  status, headers, body = @app.call env
  @response.status = status
  @response.body = body
  @response.headers.merge! headers
  nil
end