From 7ca197b37f9c8aba08560f985ec063d1c6d70a8a Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Thu, 19 Aug 2010 04:32:59 +0000 Subject: [PATCH] Merged r3933 from trunk. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.0-stable@3983 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/functional/account_controller_test.rb | 7 +++++++ .../open_id_authentication/lib/open_id_authentication.rb | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/test/functional/account_controller_test.rb b/test/functional/account_controller_test.rb index 2a8c9c66..1d66d01d 100644 --- a/test/functional/account_controller_test.rb +++ b/test/functional/account_controller_test.rb @@ -67,6 +67,13 @@ class AccountControllerTest < ActionController::TestCase assert_redirected_to 'my/page' end + def test_login_with_invalid_openid_provider + Setting.self_registration = '0' + Setting.openid = '1' + post :login, :openid_url => 'http;//openid.example.com/good_user' + assert_redirected_to home_url + end + def test_login_with_openid_for_existing_non_active_user Setting.self_registration = '2' Setting.openid = '1' diff --git a/vendor/plugins/open_id_authentication/lib/open_id_authentication.rb b/vendor/plugins/open_id_authentication/lib/open_id_authentication.rb index 22481136..70418fde 100644 --- a/vendor/plugins/open_id_authentication/lib/open_id_authentication.rb +++ b/vendor/plugins/open_id_authentication/lib/open_id_authentication.rb @@ -89,7 +89,7 @@ module OpenIdAuthentication begin uri = URI.parse(identifier) - uri.scheme = uri.scheme.downcase # URI should do this + uri.scheme = uri.scheme.downcase if uri.scheme # URI should do this identifier = uri.normalize.to_s rescue URI::InvalidURIError raise InvalidOpenId.new("#{identifier} is not an OpenID identifier")