mirror of
https://github.com/meineerde/redmine.git
synced 2026-03-28 03:31:11 +00:00
Merged r21766 from trunk to 5.0-stable (#37562).
git-svn-id: https://svn.redmine.org/redmine/branches/5.0-stable@21767 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
827239000a
commit
50e6f9535e
@ -22,6 +22,9 @@ class SysController < ActionController::Base
|
|||||||
|
|
||||||
before_action :check_enabled
|
before_action :check_enabled
|
||||||
|
|
||||||
|
# Requests from repository WS clients don't contain CSRF tokens
|
||||||
|
skip_before_action :verify_authenticity_token
|
||||||
|
|
||||||
def projects
|
def projects
|
||||||
p = Project.active.has_module(:repository).
|
p = Project.active.has_module(:repository).
|
||||||
order("#{Project.table_name}.identifier").preload(:repository).to_a
|
order("#{Project.table_name}.identifier").preload(:repository).to_a
|
||||||
|
|||||||
@ -143,4 +143,11 @@ class SysControllerTest < Redmine::ControllerTest
|
|||||||
assert_include 'Access denied', response.body
|
assert_include 'Access denied', response.body
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_should_skip_verify_authenticity_token
|
||||||
|
ActionController::Base.allow_forgery_protection = true
|
||||||
|
assert_nothing_raised {test_create_project_repository}
|
||||||
|
ensure
|
||||||
|
ActionController::Base.allow_forgery_protection = false
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user