summaryrefslogtreecommitdiff
path: root/lib/chef/http
diff options
context:
space:
mode:
authorJohn Keiser <jkeiser@opscode.com>2013-10-09 13:53:37 -0700
committerJohn Keiser <jkeiser@opscode.com>2013-10-09 13:53:37 -0700
commit5e5f5b1b1e431612a40bf235c4081dc5ff885bef (patch)
tree5197740105f70c27f6fe46d52f7bb209eceaaead /lib/chef/http
parentc13e335c6d87c50212589fdac75e46c62712ed97 (diff)
downloadchef-5e5f5b1b1e431612a40bf235c4081dc5ff885bef.tar.gz
Remove :raw_input option to JSONInput, use Chef::HTTP for knife raw
Diffstat (limited to 'lib/chef/http')
-rw-r--r--lib/chef/http/json_input.rb13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/chef/http/json_input.rb b/lib/chef/http/json_input.rb
index 5f8b700e85..741c48f5f6 100644
--- a/lib/chef/http/json_input.rb
+++ b/lib/chef/http/json_input.rb
@@ -26,19 +26,16 @@ class Chef
class JSONInput
def initialize(opts={})
- @raw_input = opts[:raw_input]
end
def handle_request(method, url, headers={}, data=false)
if data
headers["Content-Type"] = 'application/json'
- if !@raw_input
- data = Chef::JSONCompat.to_json(data)
- # Force encoding to binary to fix SSL related EOFErrors
- # cf. http://tickets.opscode.com/browse/CHEF-2363
- # http://redmine.ruby-lang.org/issues/5233
- data.force_encoding(Encoding::BINARY) if data.respond_to?(:force_encoding)
- end
+ data = Chef::JSONCompat.to_json(data)
+ # Force encoding to binary to fix SSL related EOFErrors
+ # cf. http://tickets.opscode.com/browse/CHEF-2363
+ # http://redmine.ruby-lang.org/issues/5233
+ data.force_encoding(Encoding::BINARY) if data.respond_to?(:force_encoding)
end
[method, url, headers, data]
end