diff options
author | Tim Smith <tsmith@chef.io> | 2016-10-13 11:34:26 +0100 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2016-10-13 11:34:26 +0100 |
commit | 2d3d986c751ceadc1022a46b2a856ae943fb4d65 (patch) | |
tree | 4b2484074ac07afc5b3023f249cea83eea2239ec /lib | |
parent | c46df55ae142310baf225eac1d1250d17f547844 (diff) | |
download | mixlib-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.rb | 4 | ||||
-rw-r--r-- | lib/mixlib/authentication/signedheaderauth.rb | 2 |
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] |