mirror of
https://github.com/redmine/redmine.git
synced 2026-03-06 12:31:40 +01:00
Unescape back_url param before calling redirect_to.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1893 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -46,12 +46,12 @@ class AccountControllerTest < Test::Unit::TestCase
|
||||
|
||||
def test_login_should_redirect_to_back_url_param
|
||||
# request.uri is "test.host" in test environment
|
||||
post :login, :username => 'jsmith', :password => 'jsmith', :back_url => 'http://test.host/issues/show/1'
|
||||
post :login, :username => 'jsmith', :password => 'jsmith', :back_url => 'http%3A%2F%2Ftest.host%2Fissues%2Fshow%2F1'
|
||||
assert_redirected_to '/issues/show/1'
|
||||
end
|
||||
|
||||
def test_login_should_not_redirect_to_another_host
|
||||
post :login, :username => 'jsmith', :password => 'jsmith', :back_url => 'http://test.foo/fake'
|
||||
post :login, :username => 'jsmith', :password => 'jsmith', :back_url => 'http%3A%2F%2Ftest.foo%2Ffake'
|
||||
assert_redirected_to '/my/page'
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user