Class: Sinatra::ExtendedRack
- Inherits:
-
Struct
- Object
- Struct
- Sinatra::ExtendedRack
- Defined in:
- lib/sinatra/base.rb
Overview
Some Rack handlers (Thin, Rainbows!) implement an extended body object protocol, however, some middleware (namely Rack::Lint) will break it by not mirroring the methods in question. This middleware will detect an extended body object and will make sure it reaches the handler directly. We do this here, so our middleware and middleware set up by the app will still be able to run.
Instance Attribute Summary (collapse)
-
- (Object) app
Returns the value of attribute app.
Instance Method Summary (collapse)
Instance Attribute Details
- (Object) app
Returns the value of attribute app
95 96 97 |
# File 'lib/sinatra/base.rb', line 95 def app @app end |
Instance Method Details
- (Object) call(env)
96 97 98 99 100 101 102 |
# File 'lib/sinatra/base.rb', line 96 def call(env) result, callback = app.call(env), env['async.callback'] return result unless callback and async?(*result) after_response { callback.call result } setup_close(env, *result) throw :async end |