function stripExtraTrailingSlash(str) {
  while (str.length !== 1 && str.substr(-1) === '/') {
      str = str.substr(0, str.length - 1);
  }
  return str;
}
@param {String} str - The uri that has extra slashes