From dd4fc86b5e51767e14495b2c9ed23ed9adda0da9 Mon Sep 17 00:00:00 2001 From: Marius Balteanu Date: Fri, 7 Mar 2025 07:47:08 +0000 Subject: [PATCH] Merged r23520 from trunk to 5.1-stable (#42194). git-svn-id: https://svn.redmine.org/redmine/branches/5.1-stable@23527 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- lib/redmine/sudo_mode.rb | 2 +- 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 9703f0c77..cee97fcd3 100644 --- a/lib/redmine/sudo_mode.rb +++ b/lib/redmine/sudo_mode.rb @@ -136,7 +136,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 1e65586ad..a53ed8983 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"]'