@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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @backstage/integration
2
2
 
3
+ ## 1.6.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 842eb24ef5e8: Gitiles: Fixed auth prefix issue
8
+ - Updated dependencies
9
+ - @backstage/config@1.0.8
10
+ - @backstage/errors@1.2.1
11
+
3
12
  ## 1.6.0
4
13
 
5
14
  ### Minor Changes
package/dist/index.cjs.js CHANGED
@@ -1038,9 +1038,12 @@ function getAuthenticationPrefix(config) {
1038
1038
  }
1039
1039
  function getGitilesAuthenticationUrl(config) {
1040
1040
  const parsedUrl = new URL(config.gitilesBaseUrl);
1041
- return `${parsedUrl.protocol}//${parsedUrl.host}${getAuthenticationPrefix(
1042
- config
1043
- )}${parsedUrl.pathname.substring(1)}`;
1041
+ parsedUrl.pathname = parsedUrl.pathname.replace(/\/?$/, "");
1042
+ parsedUrl.pathname = parsedUrl.pathname.replace(
1043
+ /\/([^\/]*)$/,
1044
+ `${getAuthenticationPrefix(config)}$1`
1045
+ );
1046
+ return parsedUrl.toString();
1044
1047
  }
1045
1048
  function getGerritBranchApiUrl(config, url) {
1046
1049
  const { branch, project } = parseGerritGitilesUrl(config, url);