summaryrefslogtreecommitdiff
path: root/lib/chef/http
diff options
context:
space:
mode:
authorThom May <thom@chef.io>2016-04-20 14:57:20 +0100
committerThom May <thom@chef.io>2016-04-20 14:57:20 +0100
commitecfa1343b6e5836d8ab792be83b5e096e1201fa7 (patch)
tree1abf59109f17d9da51cf451381ff2a4700fbc4db /lib/chef/http
parent3d70714756bd315abd4fab9031c87aaed59ae5a2 (diff)
downloadchef-ecfa1343b6e5836d8ab792be83b5e096e1201fa7.tar.gz
update to latest chefstyle - fix casecmptm/fix_casecmp
Diffstat (limited to 'lib/chef/http')
-rw-r--r--lib/chef/http/json_input.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/http/json_input.rb b/lib/chef/http/json_input.rb
index eaee96d88a..4cc1aa2e10 100644
--- a/lib/chef/http/json_input.rb
+++ b/lib/chef/http/json_input.rb
@@ -33,7 +33,7 @@ class Chef
def handle_request(method, url, headers = {}, data = false)
if data && should_encode_as_json?(headers)
- headers.delete_if { |key, _value| key.downcase == "content-type" }
+ headers.delete_if { |key, _value| key.casecmp("content-type").zero? }
headers["Content-Type"] = "application/json"
json_opts = {}
json_opts[:validate_utf8] = opts[:validate_utf8] if opts.has_key?(:validate_utf8)
@@ -64,7 +64,7 @@ class Chef
# ruby/Net::HTTP don't enforce capitalized headers (it normalizes them
# for you before sending the request), so we have to account for all
# the variations we might find
- requested_content_type = headers.find { |k, v| k.downcase == "content-type" }
+ requested_content_type = headers.find { |k, v| k.casecmp("content-type").zero? }
requested_content_type.nil? || requested_content_type.last.include?("json")
end