fix redirect loop regex and set res.body