diff options
author | Marius Balteanu <marius.balteanu@zitec.com> | 2025-03-06 21:45:46 +0000 |
---|---|---|
committer | Marius Balteanu <marius.balteanu@zitec.com> | 2025-03-06 21:45:46 +0000 |
commit | 4fd86cc7c11bc72456f7fa826602b223c5137b34 (patch) | |
tree | 155a8aed3edd68aca2d70c808dd2a803a4035c3f | |
parent | 40b6dce2de168df4838fbf7320d44ba74b4e710e (diff) | |
download | redmine-4fd86cc7c11bc72456f7fa826602b223c5137b34.tar.gz redmine-4fd86cc7c11bc72456f7fa826602b223c5137b34.zip |
Fixes the request method filtering in sudo mode (#42194),
Patch by Holger Just (user:hjust),
git-svn-id: https://svn.redmine.org/redmine/trunk@23520 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | lib/redmine/sudo_mode.rb | 2 | ||||
-rw-r--r-- | test/integration/sudo_mode_test.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/redmine/sudo_mode.rb b/lib/redmine/sudo_mode.rb index 39daaeeed..806d06788 100644 --- a/lib/redmine/sudo_mode.rb +++ b/lib/redmine/sudo_mode.rb @@ -153,7 +153,7 @@ module Redmine # Before Filter which is used by the require_sudo_mode class method. class SudoRequestFilter < Struct.new(:parameters, :request_methods) def before(controller) - method_matches = request_methods.blank? || request_methods.include?(controller.request.method_symbol) + method_matches = request_methods.blank? || request_methods.include?(controller.request.request_method_symbol) if controller.api_request? true elsif SudoMode.possible? && method_matches diff --git a/test/integration/sudo_mode_test.rb b/test/integration/sudo_mode_test.rb index 228e527ed..9fbbfd725 100644 --- a/test/integration/sudo_mode_test.rb +++ b/test/integration/sudo_mode_test.rb @@ -190,7 +190,7 @@ class SudoModeTest < Redmine::IntegrationTest expire_sudo_mode! get '/my/account' assert_response :success - put('/my/account', :params => {:user => {:mail => 'newmail@test.com'}}) + post('/my/account', :params => {:_method => 'put', :user => {:mail => 'newmail@test.com'}}) assert_response :success assert_select 'h2', 'Confirm your password to continue' assert_select 'form[action="/my/account"]' |