Skip to content

Commit

Permalink
fixed failing tests and the proxy code that was relying on changed be…
Browse files Browse the repository at this point in the history
…havior in action_controller/request.rb. all tests now pass on ruby 1.9.2 (woot)!
  • Loading branch information
ecavazos committed Jul 22, 2010
1 parent 55c05a6 commit 53cb37e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/oauth/request_proxy/action_controller_request.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require 'active_support'
require 'action_controller'
require 'action_controller/request'
require 'uri'

module OAuth::RequestProxy
Expand Down Expand Up @@ -33,7 +34,8 @@ def parameters_for_signature

unless options[:clobber_request]
params << header_params.to_query
params << request.query_string unless request.query_string.blank?
params << request.query_string unless query_string_blank?

if request.post? && request.content_type == Mime::Type.lookup("application/x-www-form-urlencoded")
params << request.raw_post
end
Expand Down
8 changes: 8 additions & 0 deletions lib/oauth/request_proxy/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,14 @@ def oauth_header(options = {})
"OAuth #{realm}#{header_params_str}"
end

def query_string_blank?
if uri = request.request_uri
uri.split('?', 2)[1].nil?
else
request.query_string.blank?
end
end

protected

def header_params
Expand Down
1 change: 1 addition & 0 deletions test/test_action_controller_request_proxy.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#gem 'actionpack', '2.2.3'
gem 'actionpack', '2.3.8'
require File.expand_path('../test_helper', __FILE__)

Expand Down

0 comments on commit 53cb37e

Please sign in to comment.