Back in #317 we started using Sinatra::IndifferentHash for Sinatra v2+, but didn't handle the case of a JSON array being passed as the root element. The older #indifferent_params from Sinatra v1 did handle this case. We've roughly re-created that here, though we're a little more permissive in that we allow for things that are Hash-like (via #to_hash) and Array-like (via #to_ary) rather than relying on type.
Back in #317 we started using
Sinatra::IndifferentHash
for Sinatra v2+, but didn't handle the case of a JSON array being passed as the root element. The older#indifferent_params
from Sinatra v1 did handle this case. We've roughly re-created that here, though we're a little more permissive in that we allow for things that are Hash-like (via#to_hash
) and Array-like (via#to_ary
) rather than relying on type.