summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/puppet/network/http/mongrel/rest.rb2
-rwxr-xr-xspec/unit/network/http/mongrel/rest.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/puppet/network/http/mongrel/rest.rb b/lib/puppet/network/http/mongrel/rest.rb
index fe1ed1088..8a4de1cce 100644
--- a/lib/puppet/network/http/mongrel/rest.rb
+++ b/lib/puppet/network/http/mongrel/rest.rb
@@ -41,7 +41,7 @@ class Puppet::Network::HTTP::MongrelREST < Mongrel::HttpHandler
# return the request body
def body(request)
- request.body
+ request.body.read
end
def set_content_type(response, format)
diff --git a/spec/unit/network/http/mongrel/rest.rb b/spec/unit/network/http/mongrel/rest.rb
index 5dd3d6475..01d561a48 100755
--- a/spec/unit/network/http/mongrel/rest.rb
+++ b/spec/unit/network/http/mongrel/rest.rb
@@ -59,7 +59,7 @@ describe "Puppet::Network::HTTP::MongrelREST" do
end
it "should return the request body as the body" do
- @request.expects(:body).returns "mybody"
+ @request.expects(:body).returns StringIO.new("mybody")
@handler.body(@request).should == "mybody"
end