I'm able to trigger an uncaught exception in Rack. Here is the backtrace:
expected Array (got String) for param `x'
rack (1.4.1) lib/rack/utils.rb:108:in `normalize_params'
rack (1.4.1) lib/rack/utils.rb:90:in `block in parse_nested_query'
rack (1.4.1) lib/rack/utils.rb:87:in `each'
rack (1.4.1) lib/rack/utils.rb:87:in `parse_nested_query'
rack (1.4.1) lib/rack/request.rb:334:in `parse_query'
rack (1.4.1) lib/rack/request.rb:186:in `GET'
The exception is triggered by doing:
This is also happens on POST (didn't try other verbs but I'd imagine it's all the same). Note that the order of the parameters do matter. If you do x=&x= it does not fail.
Looked at the code and accompanying tests for Rack::Utils.parse_nested_query and this is how it should behave.
I accidentally triggered this in a Rails app and also tested it against Sinatra. Was just surprised that I was able to trigger an error so deep down.