Skip to content
Browse files

escape params properly

  • Loading branch information...
1 parent 611ffd1 commit 4feaa3f99e4a99ecb7411b2b5646e824b7dbe5bf @maccman committed Sep 23, 2011
Showing with 5 additions and 5 deletions.
  1. +5 −5 lib/roauth.rb
View
10 lib/roauth.rb
@@ -21,11 +21,11 @@ def header(oauth, uri, params = {}, http_method = :get)
oauth[:token_secret] ||= oauth.delete(:access_secret)
sig_params = oauth_params(oauth)
- sig_params[:oauth_signature] = escape(
- signature(oauth, uri, sig_params.merge(params), http_method)
- )
+ sig_params[:oauth_signature] = signature(oauth, uri, sig_params.merge(params), http_method)
sorted_sig_params = sig_params.sort_by{|k,v| [k.to_s, v.to_s] }
- authorization_params = sorted_sig_params.map {|key, value| [key, "\"#{value}\""].join("=") }.join(", ")
+ authorization_params = sorted_sig_params.map {|key, value|
+ [escape(key), "\"#{escape(value)}\""].join("=")
+ }.join(", ")
%{OAuth } + authorization_params
end
@@ -67,7 +67,7 @@ def oauth_params(oauth)
OAUTH_PARAMS.include?(key)
}
oauth.inject({}) {|hash, (key, value)|
- hash["oauth_#{key}"] = escape(value)
+ hash["oauth_#{key}"] = value
hash
}
end

0 comments on commit 4feaa3f

Please sign in to comment.
Something went wrong with that request. Please try again.