summary refs log tree commit
diff options
context:
space:
mode:
authorKir Shatrov <kirs@users.noreply.github.com>2016-09-09 21:59:10 -0400
committerGitHub <noreply@github.com>2016-09-09 21:59:10 -0400
commit09d7bb95d0353419afcf1d379923bfde7cf4d482 (patch)
treec787ddd1305e9836bc929e6373af1e28e4b76cce
parent25a549883b85fb33970b4a1530a365c0c9e51f95 (diff)
downloadrack-09d7bb95d0353419afcf1d379923bfde7cf4d482.tar.gz
Freeze default session options
Some code in my app have been accidentally mutating the default session options,
which broke some session behaviour.
It wasn't easy to track that down, so I'd like to suggest that we freeze this hash
to avoid mutation.
-rw-r--r--lib/rack/session/abstract/id.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rack/session/abstract/id.rb b/lib/rack/session/abstract/id.rb
index 204bdb34..4c139637 100644
--- a/lib/rack/session/abstract/id.rb
+++ b/lib/rack/session/abstract/id.rb
@@ -200,7 +200,7 @@ module Rack
           :sidbits =>       128,
           :cookie_only =>   true,
           :secure_random => ::SecureRandom
-        }
+        }.freeze
 
         attr_reader :key, :default_options, :sid_secure