Skip to content

Commit

Permalink
fix(nexus): fix asset path for nexus repo (janus-idp#2061)
Browse files Browse the repository at this point in the history
* fix(nexus): fix asset path for nexus repo

Signed-off-by: Paul Schultz <pschultz@pobox.com>

* run prettier

Signed-off-by: Paul Schultz <pschultz@pobox.com>

---------

Signed-off-by: Paul Schultz <pschultz@pobox.com>
  • Loading branch information
schultzp2020 authored and debsmita1 committed Aug 20, 2024
1 parent 27d4d13 commit 2665ed9
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ export class NexusRepositoryManagerApiClient

private async proxiedDownloadUrl(asset: AssetXO) {
const proxyUrl = await this.getBaseUrl();
return `${proxyUrl}/repository/${asset.repository}/${asset.path}`;
// remove leading forward slash for newer versions of Nexus API
const assetPath = asset.path?.replaceAll(/^\//g, '');
return `${proxyUrl}/repository/${asset.repository}/${assetPath}`;
}

private async searchServiceFetcher(url: string, query: SearchServiceQuery) {
Expand Down
31 changes: 28 additions & 3 deletions yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2665ed9

Please sign in to comment.