I think there is a direct helper for getting at the query content, rather than the whole thing including body, in Sinatra that avoids needing to do this...  no, apparently not.  Better to use a whitelist for things you want to include, then, rather than exclude things you don't.

This may require changing this up a little to, eg, take JSON or something.  Not as nice, but probably more effective.