1
0
Fork 0
mirror of https://github.com/alangrainger/immich-public-proxy.git synced 2024-12-28 03:41:58 +00:00

Remove trailing slash on Immich URL

This commit is contained in:
Alan Grainger 2024-11-15 18:42:44 +01:00
parent fb093185d9
commit 0b5f98f145

View file

@ -30,7 +30,7 @@ class Immich {
} }
apiUrl () { apiUrl () {
return process.env.IMMICH_URL + '/api' return (process.env.IMMICH_URL || '').replace(/\/$/, '') + '/api'
} }
/** /**
@ -125,7 +125,7 @@ class Immich {
*/ */
async getShareByKey (key: string, password?: string): Promise<SharedLinkResult> { async getShareByKey (key: string, password?: string): Promise<SharedLinkResult> {
let link let link
const url = this.buildUrl(process.env.IMMICH_URL + '/api/shared-links/me', { const url = this.buildUrl(this.apiUrl() + '/shared-links/me', {
key, key,
password password
}) })
@ -166,6 +166,8 @@ class Immich {
try { try {
console.log(res.headers.get('Content-Type')) console.log(res.headers.get('Content-Type'))
console.log((await res.text()).slice(0, 500)) 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) { } catch (e) {
console.log(e) console.log(e)
} }