summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Fellinger <m.fellinger@gmail.com>2010-06-12 23:33:52 +0900
committerMichael Fellinger <m.fellinger@gmail.com>2010-06-12 23:33:52 +0900
commit9654733397ae2a7e287161ffd600682a0c7bdcc4 (patch)
tree0209ff7d5d65ee359bbaf9090c0c85a817d9523b
parent1fb12f055c55baf2ef367469a3b3ce932130c001 (diff)
downloadrack-9654733397ae2a7e287161ffd600682a0c7bdcc4.tar.gz
Fix Handler::CGI so it uses $stdin.binmode
-rw-r--r--lib/rack/handler/cgi.rb13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/rack/handler/cgi.rb b/lib/rack/handler/cgi.rb
index 692daa92..d4d000eb 100644
--- a/lib/rack/handler/cgi.rb
+++ b/lib/rack/handler/cgi.rb
@@ -4,6 +4,7 @@ module Rack
module Handler
class CGI
def self.run(app, options=nil)
+ $stdin.binmode
serve app
end
@@ -40,20 +41,20 @@ module Rack
end
def self.send_headers(status, headers)
- STDOUT.print "Status: #{status}\r\n"
+ $stdout.print "Status: #{status}\r\n"
headers.each { |k, vs|
vs.split("\n").each { |v|
- STDOUT.print "#{k}: #{v}\r\n"
+ $stdout.print "#{k}: #{v}\r\n"
}
}
- STDOUT.print "\r\n"
- STDOUT.flush
+ $stdout.print "\r\n"
+ $stdout.flush
end
def self.send_body(body)
body.each { |part|
- STDOUT.print part
- STDOUT.flush
+ $stdout.print part
+ $stdout.flush
}
end
end