Fixes bug 978098 - Accept query string parameters in the middleware.

@peterbe r?