Fixes bug 978098 - Accept query string parameters in the middleware.
Removed all double-encoding things.