Skip to content

Commit 12c4b77

Browse files
committed
SecureRandom.urlsafe_base64 doesn't have padding: false keyword argument
Actually it is regarded truthy as `padding = { padding: false }`. https://docs.ruby-lang.org/en/2.7.0/Random/Formatter.html#method-i-urlsafe_base64
1 parent d071982 commit 12c4b77

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
@@ -469,7 +469,7 @@ def normalize_action_path(action_path) # :doc:
469469

470470
def generate_csrf_token # :nodoc:
471471
if urlsafe_csrf_tokens
472-
SecureRandom.urlsafe_base64(AUTHENTICITY_TOKEN_LENGTH, padding: false)
472+
SecureRandom.urlsafe_base64(AUTHENTICITY_TOKEN_LENGTH)
473473
else
474474
SecureRandom.base64(AUTHENTICITY_TOKEN_LENGTH)
475475
end

0 commit comments

Comments
 (0)