example/rack_handler.rb in m2r-0.0.2 vs example/rack_handler.rb in m2r-0.0.3
- old
+ new
@@ -48,10 +48,10 @@
"SCRIPT_NAME" => script_name,
"PATH_INFO" => req.headers["PATH"].gsub(script_name, ''),
"QUERY_STRING" => req.headers["QUERY"]
}
- env["SERVER_NAME"], env["SERVER_PORT"] = req.headers["Host"].split(':', 2)
+ env["SERVER_NAME"], env["SERVER_PORT"] = req.headers["host"].split(':', 2)
req.headers.each do |key, val|
unless key =~ /content_(type|length)/i
key = "HTTP_#{key.upcase}"
end
env[key] = val