Adding querystring to middleware