summaryrefslogtreecommitdiffstats
path: root/lib/puppet/network
diff options
context:
space:
mode:
authorJames Turnbull <james@lovedthanlost.net>2009-07-08 08:44:19 +1000
committerJames Turnbull <james@lovedthanlost.net>2009-07-08 08:44:19 +1000
commit1fd98b15a4f93c77182b080c68960d6d1c0bcd59 (patch)
treec73631215245c7fb9433860c4e6df32eabafc4c0 /lib/puppet/network
parent8b09b8316e5f385522fcc4353b3cea725076fb25 (diff)
downloadpuppet-1fd98b15a4f93c77182b080c68960d6d1c0bcd59.tar.gz
puppet-1fd98b15a4f93c77182b080c68960d6d1c0bcd59.tar.xz
puppet-1fd98b15a4f93c77182b080c68960d6d1c0bcd59.zip
Fixes #2367 - Mongrel::HTTPRequest returns a StringIO object
When the PUT body is large enough that Mongrel::HTTPRequest#body returns a StringIO object instead of a String. StringIO#to_s then returns "<StringIO#8236987299>" instead of the string contents. When that string is passed to YAML it returns false which is then passed to save_object without any real time checking. This is a combination of patches from Jordan Curzon and Ricky Zhou.
Diffstat (limited to 'lib/puppet/network')
-rw-r--r--lib/puppet/network/http/mongrel/rest.rb2
1 files changed, 1 insertions, 1 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)