From e7b72c4019699f0b928e52a76e28b739a82425af Mon Sep 17 00:00:00 2001 From: Jesse Jensen Date: Fri, 8 Jan 2016 15:54:41 -0600 Subject: [PATCH] use [0] instead of first on string In newer versions of Ruby, there's no String#first method, but from 1.9+, using the [0] substring method will work. --- lib/rawscsi/request_signature.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rawscsi/request_signature.rb b/lib/rawscsi/request_signature.rb index eacc079..ce24a55 100644 --- a/lib/rawscsi/request_signature.rb +++ b/lib/rawscsi/request_signature.rb @@ -133,7 +133,7 @@ def canonical_headers_names_string def canonical_headers @canonical_headers ||= headers.to_a.group_by(&:first).map do |name, values| canonical_values = values.map(&:last).map do |value| - value.to_s.first == '"' ? value : value.squeeze(' ') + value.to_s.[0]] == '"' ? value : value.squeeze(' ') end [ name.to_s.downcase, canonical_values.join(',') ] end.sort { |a, b| a.first <=> b.first }