1
0
Fork 0
mirror of https://github.com/alangrainger/immich-public-proxy.git synced 2024-12-29 12:21:57 +00:00

Add accept-ranges header

This commit is contained in:
Alan Grainger 2024-11-11 12:10:53 +01:00
parent 4310a92ea7
commit a7159f2a72

View file

@ -24,7 +24,8 @@ class Render {
const startByte = parseInt(start, 10) || 0 const startByte = parseInt(start, 10) || 0
const endByte = startByte + 2499999 const endByte = startByte + 2499999
headers.range = `bytes=${startByte}-${endByte}` headers.range = `bytes=${startByte}-${endByte}`
headerList.push('accept-ranges', 'content-range') headerList.push('cache-control', 'content-range')
res.setHeader('accept-ranges', 'bytes')
res.status(206) // Partial Content res.status(206) // Partial Content
} }
const url = immich.buildUrl(immich.apiUrl() + '/assets/' + encodeURIComponent(asset.id) + subpath, { const url = immich.buildUrl(immich.apiUrl() + '/assets/' + encodeURIComponent(asset.id) + subpath, {