Skip to content
This repository has been archived by the owner on May 16, 2021. It is now read-only.

ensure Rack::Protection::Base#random_string always outputs 32 characters #69

Merged
merged 1 commit into from Sep 9, 2013
Merged

ensure Rack::Protection::Base#random_string always outputs 32 characters #69

merged 1 commit into from Sep 9, 2013

Conversation

pje
Copy link
Contributor

@pje pje commented Sep 9, 2013

Prior to this commit, authenticity tokens would be either 32 or 64 characters long, depending on the presence of SecureRandom in the environment.

This changes Rack::Protection::Base#random_string to always output strings of 32 characters, ensuring that generated authenticity tokens will always have the same length (whether we're using SecureRandom.hex or Kernel.rand).

(See here for more discussion.)

rkh added a commit that referenced this pull request Sep 9, 2013
ensure Rack::Protection::Base#random_string always outputs 32 characters
@rkh rkh merged commit 04335ec into sinatra:master Sep 9, 2013
zzak pushed a commit that referenced this pull request Aug 12, 2016
ensure Rack::Protection::Base#random_string always outputs 32 characters
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants