Skip to content

Commit

Permalink
Remove trailing slash on Immich URL
Browse files Browse the repository at this point in the history
  • Loading branch information
alangrainger committed Nov 15, 2024
1 parent fb09318 commit 0b5f98f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/src/immich.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Immich {
}

apiUrl () {
return process.env.IMMICH_URL + '/api'
return (process.env.IMMICH_URL || '').replace(/\/$/, '') + '/api'
}

/**
Expand Down Expand Up @@ -125,7 +125,7 @@ class Immich {
*/
async getShareByKey (key: string, password?: string): Promise<SharedLinkResult> {
let link
const url = this.buildUrl(process.env.IMMICH_URL + '/api/shared-links/me', {
const url = this.buildUrl(this.apiUrl() + '/shared-links/me', {
key,
password
})
Expand Down Expand Up @@ -166,6 +166,8 @@ class Immich {
try {
console.log(res.headers.get('Content-Type'))
console.log((await res.text()).slice(0, 500))
log('Unexpected response from Immich API at ' + this.apiUrl())
log('Please make sure the IPP container is able to reach this path.')
} catch (e) {
console.log(e)
}
Expand Down

0 comments on commit 0b5f98f

Please sign in to comment.