Skip to content

Commit 3436c8f

Browse files
committed
Allow empty parameters.
1 parent cb9b9db commit 3436c8f

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

lib/oauth/client/helper.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def timestamp
2727
end
2828

2929
def oauth_parameters
30-
{
30+
out = {
3131
'oauth_body_hash' => options[:body_hash],
3232
'oauth_callback' => options[:oauth_callback],
3333
'oauth_consumer_key' => options[:consumer].key,
@@ -38,7 +38,11 @@ def oauth_parameters
3838
'oauth_verifier' => options[:oauth_verifier],
3939
'oauth_version' => (options[:oauth_version] || '1.0'),
4040
'oauth_session_handle' => options[:oauth_session_handle]
41-
}.reject { |k,v| v.to_s == "" }
41+
}
42+
if !options[:allow_empty_params]
43+
out.reject! { |k,v| v.to_s == '' }
44+
end
45+
out
4246
end
4347

4448
def signature(extra_options = {})

lib/oauth/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module OAuth
2-
VERSION = "0.5.4"
2+
VERSION = "0.5.5"
33
end

0 commit comments

Comments
 (0)