Skip to content

Commit d0b6797

Browse files
authored
Merge pull request rails#54583 from skipkayhil/hm-opt-verified-request
Do cheap/happy check first in `verified_request?`
2 parents a7ea61f + e133b38 commit d0b6797

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

actionpack/lib/action_controller/metal/request_forgery_protection.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ def non_xhr_javascript_response? # :doc:
468468
# * Does the `X-CSRF-Token` header match the form_authenticity_token?
469469
#
470470
def verified_request? # :doc:
471-
!protect_against_forgery? || request.get? || request.head? ||
471+
request.get? || request.head? || !protect_against_forgery? ||
472472
(valid_request_origin? && any_authenticity_token_valid?)
473473
end
474474

0 commit comments

Comments
 (0)