Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
diff --git a/lib/puppet/indirector/rest.rb b/lib/puppet/indirector/rest.rb index a89e986..3e20b53 100644 --- a/lib/puppet/indirector/rest.rb +++ b/lib/puppet/indirector/rest.rb @@ -43,6 +43,8 @@ class Puppet::Indirector::REST < Puppet::Indirector::Terminus content_type = response['content-type'].gsub(/\s*;.*$/,'') # strip any appended charset + File.open("/tmp/#{indirection.name}.#{content_type}", "w") { |f| f.print response.body } + # Convert the response to a deserialized object. if multiple model.convert_from_multiple(content_type, response.body)
This paste will be private.
From the Design Piracy series on my blog: