code: function isMatchRule(req, pathname, rule) {
    if (typeof rule === 'string') {
      return pathname.indexOf(rule) > -1;
    } else if (rule instanceof RegExp) {
      return rule.test(pathname);
    } else if (typeof rule === 'function') {
      return rule(pathname, req);
    }
  }
docs: Return `true` when pathname match the rule.
  
  @param req
  @param pathname
  @param rule
  @returns {*}