Fix to perform regex on a string, since res.statusCode returns an integer