Fix AjaxRedirectMiddleware