lib/rack/handler/mongrel2.rb in rack-mongrel2-0.2.3 vs lib/rack/handler/mongrel2.rb in rack-mongrel2-0.2.4
- old
+ new
@@ -5,12 +5,12 @@
module Handler
class Mongrel2
class << self
def run(app, options = {})
options = {
- :recv => 'tcp://127.0.0.1:9997' || ENV['RACK_MONGREL2_RECV'],
- :send => 'tcp://127.0.0.1:9996' || ENV['RACK_MONGREL2_SEND'],
+ :recv => ENV['RACK_MONGREL2_RECV'] || 'tcp://127.0.0.1:9997',
+ :send => ENV['RACK_MONGREL2_SEND'] || 'tcp://127.0.0.1:9996',
:uuid => ENV['RACK_MONGREL2_UUID']
}.merge(options)
raise ArgumentError.new('Must specify an :uuid or set RACK_MONGREL2_UUID') if options[:uuid].nil?
@@ -40,10 +40,11 @@
'rack.multithread' => true,
'rack.multiprocess' => true,
'rack.run_once' => false,
'mongrel2.pattern' => req.headers['PATTERN'],
'REQUEST_METHOD' => req.headers['METHOD'],
+ 'CONTENT_TYPE' => req.headers['content-type'],
'SCRIPT_NAME' => script_name,
'PATH_INFO' => req.headers['PATH'].gsub(script_name, ''),
'QUERY_STRING' => req.headers['QUERY'] || ''
}
@@ -64,6 +65,6 @@
conn.close if conn.respond_to?(:close)
end
end
end
end
-end
\ No newline at end of file
+end