From c75b82d39256f52d39e434f348e05f5c94b198cd Mon Sep 17 00:00:00 2001 From: Steeve Morin Date: Tue, 27 Sep 2011 18:32:38 +0300 Subject: [PATCH 1/2] Only put option when there is a value. (Causes errors with Netflix API). --- lib/simple_oauth/header.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/simple_oauth/header.rb b/lib/simple_oauth/header.rb index 5d81a75..e824fc5 100644 --- a/lib/simple_oauth/header.rb +++ b/lib/simple_oauth/header.rb @@ -66,7 +66,7 @@ module SimpleOAuth end def attributes - ATTRIBUTE_KEYS.inject({}){|a,k| options.key?(k) ? a.merge(:"oauth_#{k}" => options[k]) : a } + ATTRIBUTE_KEYS.inject({}){|a,k| options.key?(k) and options[k] ? a.merge(:"oauth_#{k}" => options[k]) : a } end def signature From 62a01b6d1800312de82c0a2398481eda12a43462 Mon Sep 17 00:00:00 2001 From: Steeve Morin Date: Wed, 28 Sep 2011 14:21:40 +0300 Subject: [PATCH 2/2] simple key/value presence test for attributes --- lib/simple_oauth/header.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/simple_oauth/header.rb b/lib/simple_oauth/header.rb index e824fc5..d1f1154 100644 --- a/lib/simple_oauth/header.rb +++ b/lib/simple_oauth/header.rb @@ -66,7 +66,7 @@ module SimpleOAuth end def attributes - ATTRIBUTE_KEYS.inject({}){|a,k| options.key?(k) and options[k] ? a.merge(:"oauth_#{k}" => options[k]) : a } + ATTRIBUTE_KEYS.inject({}){|a,k| options[k] ? a.merge(:"oauth_#{k}" => options[k]) : a } end def signature