summaryrefslogtreecommitdiff
path: root/lib/chef
diff options
context:
space:
mode:
authorJohn Keiser <jkeiser@opscode.com>2013-07-03 08:44:13 -0600
committerJohn Keiser <jkeiser@opscode.com>2013-09-12 23:10:54 -0700
commit2a9f3e7178379fe70303042ded5c3b52dca25f42 (patch)
tree0949fed29712692c2dfdc42f666ec1ad8b260327 /lib/chef
parent318c63fa7e7155bcf65af0ec8777041262146c3c (diff)
downloadchef-2a9f3e7178379fe70303042ded5c3b52dca25f42.tar.gz
Fix raw json option with redirect tests
Diffstat (limited to 'lib/chef')
-rw-r--r--lib/chef/chef_fs/raw_request.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/chef/chef_fs/raw_request.rb b/lib/chef/chef_fs/raw_request.rb
index d5a312ba3c..e017589fa4 100644
--- a/lib/chef/chef_fs/raw_request.rb
+++ b/lib/chef/chef_fs/raw_request.rb
@@ -5,12 +5,12 @@ class Chef
api_request(chef_rest, :GET, chef_rest.create_url(api_path), {}, nil, :parse_json => true)
end
- def self.raw_request(chef_rest, api_path, options)
- api_request(chef_rest, :GET, chef_rest.create_url(api_path), {}, nil)
+ def self.raw_request(chef_rest, api_path)
+ api_request(chef_rest, :GET, chef_rest.create_url(api_path))
end
def self.api_request(chef_rest, method, url, headers={}, data=nil, options = {})
- json_body = data ? data : nil
+ json_body = data || nil
# json_body = data ? Chef::JSONCompat.to_json(data) : nil
# Force encoding to binary to fix SSL related EOFErrors
# cf. http://tickets.opscode.com/browse/CHEF-2363
@@ -32,7 +32,7 @@ class Chef
elsif redirect_location = redirected_to(response)
if [:GET, :HEAD].include?(method)
chef_rest.follow_redirect do
- api_request(chef_rest, method, chef_rest.create_url(redirect_location), headers, nil, convert_json)
+ api_request(chef_rest, method, chef_rest.create_url(redirect_location), headers, nil, options)
end
else
raise Exceptions::InvalidRedirect, "#{method} request was redirected from #{url} to #{redirect_location}. Only GET and HEAD support redirects."