From 55f9032def3eafff68bda110ab14b6c1d6709137 Mon Sep 17 00:00:00 2001 From: Russ Smith Date: Tue, 10 Mar 2009 09:21:49 -0700 Subject: [PATCH] Making sure that any IO reads from the server are a String. The LSAPI seems to not be functioning like it's supposed to, but with these small changes to Rails, it works ok. --- .../lib/action_controller/rewindable_input.rb | 2 +- .../vendor/rack-1.0/rack/request.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/actionpack/lib/action_controller/rewindable_input.rb b/actionpack/lib/action_controller/rewindable_input.rb index cedfb7f..bba5cab 100644 --- a/actionpack/lib/action_controller/rewindable_input.rb +++ b/actionpack/lib/action_controller/rewindable_input.rb @@ -8,7 +8,7 @@ module ActionController def method_missing(method, *args, &block) unless @rewindable - @io = ::StringIO.new(@io.read) + @io = ::StringIO.new(@io.read.to_s) @rewindable = true end diff --git a/actionpack/lib/action_controller/vendor/rack-1.0/rack/request.rb b/actionpack/lib/action_controller/vendor/rack-1.0/rack/request.rb index d77fa26..acd7dc4 100644 --- a/actionpack/lib/action_controller/vendor/rack-1.0/rack/request.rb +++ b/actionpack/lib/action_controller/vendor/rack-1.0/rack/request.rb @@ -123,7 +123,7 @@ module Rack @env["rack.request.form_input"] = @env["rack.input"] unless @env["rack.request.form_hash"] = Utils::Multipart.parse_multipart(env) - form_vars = @env["rack.input"].read + form_vars = @env["rack.input"].read.to_s # Fix for Safari Ajax postings that always append \0 form_vars.sub!(/\0\z/, '') -- 1.6.1.3