summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2016-10-13 11:34:26 +0100
committerTim Smith <tsmith@chef.io>2016-10-13 11:34:26 +0100
commit2d3d986c751ceadc1022a46b2a856ae943fb4d65 (patch)
tree4b2484074ac07afc5b3023f249cea83eea2239ec /lib
parentc46df55ae142310baf225eac1d1250d17f547844 (diff)
downloadmixlib-authentication-2d3d986c751ceadc1022a46b2a856ae943fb4d65.tar.gz
Chefstyle fixes
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib')
-rw-r--r--lib/mixlib/authentication/digester.rb4
-rw-r--r--lib/mixlib/authentication/signedheaderauth.rb2
2 files changed, 2 insertions, 4 deletions
diff --git a/lib/mixlib/authentication/digester.rb b/lib/mixlib/authentication/digester.rb
index 8628d53..f826b4c 100644
--- a/lib/mixlib/authentication/digester.rb
+++ b/lib/mixlib/authentication/digester.rb
@@ -27,9 +27,7 @@ module Mixlib
def hash_file(f, digest = OpenSSL::Digest::SHA1)
digester = digest.new
buf = ""
- while f.read(16384, buf)
- digester.update buf
- end
+ digester.update buf while f.read(16384, buf)
::Base64.encode64(digester.digest).chomp
end
diff --git a/lib/mixlib/authentication/signedheaderauth.rb b/lib/mixlib/authentication/signedheaderauth.rb
index ab8d989..855fd80 100644
--- a/lib/mixlib/authentication/signedheaderauth.rb
+++ b/lib/mixlib/authentication/signedheaderauth.rb
@@ -274,7 +274,7 @@ module Mixlib
def server_api_version
key = (self[:headers] || {}).keys.select do |k|
- k.downcase == "x-ops-server-api-version"
+ k.casecmp("x-ops-server-api-version").zero?
end.first
if key
self[:headers][key]