@backstage/integration 1.6.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -1029,9 +1029,12 @@ function getAuthenticationPrefix(config) {
1029
1029
  }
1030
1030
  function getGitilesAuthenticationUrl(config) {
1031
1031
  const parsedUrl = new URL(config.gitilesBaseUrl);
1032
- return `${parsedUrl.protocol}//${parsedUrl.host}${getAuthenticationPrefix(
1033
- config
1034
- )}${parsedUrl.pathname.substring(1)}`;
1032
+ parsedUrl.pathname = parsedUrl.pathname.replace(/\/?$/, "");
1033
+ parsedUrl.pathname = parsedUrl.pathname.replace(
1034
+ /\/([^\/]*)$/,
1035
+ `${getAuthenticationPrefix(config)}$1`
1036
+ );
1037
+ return parsedUrl.toString();
1035
1038
  }
1036
1039
  function getGerritBranchApiUrl(config, url) {
1037
1040
  const { branch, project } = parseGerritGitilesUrl(config, url);