code: function baseStringUri(uri) {
      var parsed = url.parse(uri);
  
      //  The port MUST be included if it is not the default port for the
      //  scheme, and MUST be excluded if it is the default.
      if (parsed.protocol === 'https:/') {
          parsed.host = parsed.host.replace(/:443$/, '');
      } else if (parsed.protocol === 'http:/') {
          parsed.host = parsed.host.replace(/:80$/, '');
      }
  
      return url.format({
          protocol: parsed.protocol,
          host: parsed.host,
          auth: parsed.auth,
          pathname: parsed.pathname
      });
  }
docs: Base String URI http://tools.ietf.org/html/rfc5849#section-3.4.1.2