mirror of
https://github.com/alangrainger/immich-public-proxy.git
synced 2024-12-28 20:01:57 +00:00
Remove trailing slash on Immich URL
This commit is contained in:
parent
fb093185d9
commit
0b5f98f145
1 changed files with 4 additions and 2 deletions
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue