Module: Iodine::Http::Rack
- Defined in:
- lib/iodine/http/rack_support.rb
Overview
This (will be) a Rack handler for the Iodine HTTP server.
Class Method Summary collapse
Class Method Details
.call(request, response) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/iodine/http/rack_support.rb', line 16 def call request, response if @pre_rack_handler tmp = @pre_rack_handler.call(request, response) return tmp if tmp end # response.quite! res = @app.call rack_env(request) raise "Rack app returned an unexpected value: #{res.to_s}" unless res && res.is_a?(Array) response.status = res[0] response.headers.clear response.headers.update res[1] response.body = res[2] response..clear response.headers['Set-Cookie'] = response.headers.delete('Set-Cookie').split("\n").join("\r\nSet-Cookie: ") if response.headers['Set-Cookie'] response.request[:no_log] = true true end |