From 19ed709b09e7d942dadb285150a7b41225a2236f Mon Sep 17 00:00:00 2001 From: Jamis Buck Date: Fri, 11 May 2007 16:30:57 +0000 Subject: don't assume the http authorization header will be nil, since some configurations will pass it through as an empty string git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6718 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/http_authentication.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/actionpack/lib/action_controller/http_authentication.rb b/actionpack/lib/action_controller/http_authentication.rb index 269858633e..fbc34d1f2e 100644 --- a/actionpack/lib/action_controller/http_authentication.rb +++ b/actionpack/lib/action_controller/http_authentication.rb @@ -86,10 +86,10 @@ module ActionController end def authenticate(controller, &login_procedure) - if authorization(controller.request) - login_procedure.call(*user_name_and_password(controller.request)) - else + if authorization(controller.request).blank? false + else + login_procedure.call(*user_name_and_password(controller.request)) end end @@ -118,4 +118,4 @@ module ActionController end end end -end \ No newline at end of file +end -- cgit v1.2.3