by mapgrep · 13y ago · 0 comments
This seems like poor method naming; I would not intuitively understand that "load" is far more dangerous than "parse."
Why not deprecate these and do names like
JSON.load_trusted
JSON.load_untrusted
To further confuse things, JSON.load has the very useful property that you can pass it a String or an IO (e.g. from Rack::Request#body), whereas JSON.parse only accepts a String.
edit: the docs will soon contain a warning about JSON.load; see https://github.com/flori/json/blob/master/lib/json/common.rb