Devise should respect script_name and path_info contracts. This closes #331, a long standing bug with Passenger.

This commit is contained in:
José Valim 2010-07-01 13:50:05 +02:00
parent 8e3ef2a620
commit 421256d294
2 changed files with 8 additions and 1 deletions

View File

@ -39,7 +39,7 @@ module Devise
# Attempt to find the mapped route for devise based on request path
def devise_mapping
@devise_mapping ||= begin
mapping = Devise::Mapping.find_by_path(request.path)
mapping = Devise::Mapping.find_by_path(request.path_info)
mapping ||= Devise.mappings[Devise.default_scope] if Devise.use_default_scope
mapping
end

View File

@ -285,6 +285,13 @@ class AuthenticationWithScopesTest < ActionController::IntegrationTest
assert_contain 'Sign in'
end
end
test 'sign in with script name' do
assert_nothing_raised do
get new_user_session_path, {}, "SCRIPT_NAME" => "/omg"
fill_in "email", "user@test.com"
end
end
end
class AuthenticationOthersTest < ActionController::IntegrationTest