You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @knarewski! Thanks for the issue and the repro!
Please send a PR 🎉 We should also protect it against other types. if JSON.parse returns anything other than a Hash, split wouldn't know how to handle it.
Hi @andrehjr ! Thank you for such a swift response 🚀 ! I prepared a fix, but it's blocked by an unrelated CI failure. I'm happy to submit a PR once the CI fix is merged: #696
Describe the bug
When
split
cookie is a valid, json encoded String, aNoMethodError
is raised.To Reproduce
Steps to reproduce the behavior:
test.rb
ruby test.rb
curl -H "User-Agent: not-a-bot" -H 'Cookie: split="valid-json-string"' localhost:4567
NoMethodError - undefined method `keys' for "valid-json-string":String
Expected behavior
The invalid content is ignored, similarly to how unparseable JSON is ignored
Additional context
The trivial check in cookie_adapter.rb works for me:
I'm happy to submit a PR if desired
The text was updated successfully, but these errors were encountered: