Mark sensitive user forms with Cache-Control: no-store (#42998).

Patch by Holger Just (user:hjust).

git-svn-id: https://svn.redmine.org/redmine/trunk@23942 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Marius Balteanu
2025-09-07 06:15:43 +00:00
parent 5f4ce0fe0e
commit e67680a694
2 changed files with 27 additions and 4 deletions

View File

@@ -438,6 +438,8 @@ class UsersControllerTest < Redmine::ControllerTest
def test_new
get :new
assert_response :success
assert_includes @response.headers['Cache-Control'], 'no-store'
assert_select 'input[name=?]', 'user[login]'
assert_select 'label[for=?]>span.required', 'user_password', 1
end
@@ -554,6 +556,8 @@ class UsersControllerTest < Redmine::ControllerTest
post :create, :params => {:user => {:login => 'foo'}}
end
assert_response :success
assert_includes @response.headers['Cache-Control'], 'no-store'
assert_select_error /Email cannot be blank/
end
@@ -640,6 +644,8 @@ class UsersControllerTest < Redmine::ControllerTest
end
assert_response :success
assert_includes @response.headers['Cache-Control'], 'no-store'
assert_select 'h2>a+img.gravatar'
assert_select 'input[name=?][value=?]', 'user[login]', 'jsmith'
assert_select 'label[for=?]>span.required', 'user_password', 0
@@ -695,6 +701,8 @@ class UsersControllerTest < Redmine::ControllerTest
}
end
assert_response :success
assert_includes @response.headers['Cache-Control'], 'no-store'
assert_select_error /First name cannot be blank/
end