A request handler for Rack applications.

Methods
Public Class methods
new(owner_pipe, app, options = {})

app is the Rack application object.

    # File lib/phusion_passenger/rack/request_handler.rb, line 50
50:         def initialize(owner_pipe, app, options = {})
51:                 super(owner_pipe, options)
52:                 @app = app
53:         end
Protected Instance methods
process_request(env, input, output)

Overrided method.

    # File lib/phusion_passenger/rack/request_handler.rb, line 57
57:         def process_request(env, input, output)
58:                 env[RACK_VERSION]      = RACK_VERSION_VALUE
59:                 env[RACK_INPUT]        = input
60:                 env[RACK_ERRORS]       = STDERR
61:                 env[RACK_MULTITHREAD]  = false
62:                 env[RACK_MULTIPROCESS] = true
63:                 env[RACK_RUN_ONCE]     = false
64:                 env[SCRIPT_NAME]     ||= ''
65:                 if ENV.has_key?(PATH_INFO)
66:                         env[PATH_INFO].sub!(/^#{Regexp.escape(env[SCRIPT_NAME])}/, "")
67:                 end
68:                 if env[HTTPS] == YES || env[HTTPS] == ON || env[HTTPS] == ONE
69:                         env[RACK_URL_SCHEME] = HTTPS_DOWNCASE
70:                 else
71:                         env[RACK_URL_SCHEME] = HTTP
72:                 end
73:                 
74:                 status, headers, body = @app.call(env)
75:                 begin
76:                         output.write("Status: #{status}#{CRLF}")
77:                         headers[X_POWERED_BY] = PASSENGER_HEADER
78:                         headers.each_pair do |key, values|
79:                                 if values.is_a?(String)
80:                                         values = values.split("\n")
81:                                 end
82:                                 values.each do |value|
83:                                         output.write("#{key}: #{value}#{CRLF}")
84:                                 end
85:                         end
86:                         output.write(CRLF)
87:                         if body.is_a?(String)
88:                                 output.write(body)
89:                         elsif body
90:                                 body.each do |s|
91:                                         output.write(s)
92:                                 end
93:                         end
94:                 ensure
95:                         body.close if body.respond_to?(:close)
96:                 end
97:         end