# File lib/rack/handler/cgi.rb, line 11
11:       def self.serve(app)
12:         app = ContentLength.new(app)
13: 
14:         env = ENV.to_hash
15:         env.delete "HTTP_CONTENT_LENGTH"
16: 
17:         env["SCRIPT_NAME"] = ""  if env["SCRIPT_NAME"] == "/"
18: 
19:         env.update({"rack.version" => Rack::VERSION,
20:                      "rack.input" => $stdin,
21:                      "rack.errors" => $stderr,
22: 
23:                      "rack.multithread" => false,
24:                      "rack.multiprocess" => true,
25:                      "rack.run_once" => true,
26: 
27:                      "rack.url_scheme" => ["yes", "on", "1"].include?(ENV["HTTPS"]) ? "https" : "http"
28:                    })
29: 
30:         env["QUERY_STRING"] ||= ""
31:         env["HTTP_VERSION"] ||= env["SERVER_PROTOCOL"]
32:         env["REQUEST_PATH"] ||= "/"
33: 
34:         status, headers, body = app.call(env)
35:         begin
36:           send_headers status, headers
37:           send_body body
38:         ensure
39:           body.close  if body.respond_to? :close
40:         end
41:       end