Skip to content

Loading…

Stringify the keys in SessionHash#merge #428

Closed
wants to merge 1 commit into from

3 participants

@leifg

As mentioned in #427 the merge! method does not take care of stringifying the keys. That leads to errors if you add symbol (or other non-string) keys as the values will never be read as the fetch converts everything to a string:

def [](key)
    load_for_read!
    super(key.to_s)
end
@travisbot

This pull request passes (merged f0b47d0 into ea7ed1a).

@raggi
Official Rack repositories member

Apologies for not just merging, duped this change in 6b115c5, as i was looking at the issue not the PR. Avoid this by opening one :)

Thanks.

@raggi raggi closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 5, 2012
  1. add stringify_keys for SessionHash#merge

    Leif Gensert committed
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/rack/session/abstract/id.rb
View
2 lib/rack/session/abstract/id.rb
@@ -122,7 +122,7 @@ def empty?
def merge!(hash)
load_for_write!
- super
+ super(stringify_keys(hash))
end
private
Something went wrong with that request. Please try again.