Skip to content

Commit

Permalink
fix: add fix (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrotambo authored Mar 6, 2023
1 parent 76e172f commit 393a60a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/logic/profiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,13 @@ function addBaseUrlToSnapshots(baseUrl: string, snapshots: Snapshots, content: M
}

function addBaseUrlToSnapshot(baseUrl: string, snapshot: string, content: Map<string, string>): string {
const cleanedBaseUrl = baseUrl.endsWith('/') ? baseUrl : baseUrl + '/'
if (content.has(snapshot)) {
// Snapshot references a content file
const hash = content.get(snapshot)!
return baseUrl + `/contents/${hash}`
return cleanedBaseUrl + `contents/${hash}`
} else {
// Snapshot is directly a hash
return baseUrl + `/contents/${snapshot}`
return cleanedBaseUrl + `contents/${snapshot}`
}
}

0 comments on commit 393a60a

Please sign in to comment.