From cc7510f6a514859e0bd1a7abeeb3e730c49dd416 Mon Sep 17 00:00:00 2001 From: laserlemon Date: Wed, 13 Oct 2010 08:18:19 -0400 Subject: [PATCH] Updated parameter and attribute sorting during normalization to behave consistently across Ruby versions 1.8.7 and 1.9.2. --- lib/simple_oauth.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/simple_oauth.rb b/lib/simple_oauth.rb index 68d18f4..6f1f64a 100644 --- a/lib/simple_oauth.rb +++ b/lib/simple_oauth.rb @@ -69,7 +69,7 @@ module SimpleOAuth private def normalized_attributes - signed_attributes.sort_by(&:to_s).map{|k,v| %(#{k}="#{self.class.encode(v)}") }.join(', ') + signed_attributes.sort_by{|k,v| k.to_s }.map{|k,v| %(#{k}="#{self.class.encode(v)}") }.join(', ') end def signed_attributes @@ -103,7 +103,7 @@ module SimpleOAuth end def normalized_params - signature_params.sort_by(&:to_s).map{|p| p.map{|v| self.class.encode(v) }.join('=') }.join('&') + signature_params.map{|p| p.map{|v| self.class.encode(v) } }.sort.map{|p| p.join('=') }.join('&') end def signature_params