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

Fix #11 image headers being sent as 'undefined'

This commit is contained in:
Alan Grainger 2024-11-03 11:22:38 +01:00
parent 80eaffed85
commit da5930fab1
3 changed files with 8 additions and 9 deletions

View file

@ -2,12 +2,15 @@ FROM node:lts-slim
WORKDIR /app WORKDIR /app
COPY app/package.json ./ COPY app/ ./
RUN npm install --omit=dev
RUN npm install pm2 -g RUN npm install pm2 -g
COPY app/ ./ RUN chown -R node:node /app
USER node
RUN npm install --omit=dev
ENV NODE_ENV=production ENV NODE_ENV=production
@ -15,10 +18,6 @@ ENV NODE_ENV=production
# dev-dependencies above to save space in the final build # dev-dependencies above to save space in the final build
RUN npx tsc --noCheck RUN npx tsc --noCheck
RUN chown -R node:node /app
USER node
HEALTHCHECK --interval=30s --start-period=10s --timeout=5s CMD node /app/healthcheck.js || exit 1 HEALTHCHECK --interval=30s --start-period=10s --timeout=5s CMD node /app/healthcheck.js || exit 1
CMD ["pm2-runtime", "dist/index.js" ] CMD ["pm2-runtime", "dist/index.js" ]

View file

@ -1,6 +1,6 @@
{ {
"name": "immich-public-proxy", "name": "immich-public-proxy",
"version": "1.3.4", "version": "1.3.5",
"scripts": { "scripts": {
"dev": "ts-node src/index.ts", "dev": "ts-node src/index.ts",
"build": "npx tsc", "build": "npx tsc",

View file

@ -17,7 +17,7 @@ class Render {
const data = await immich.getAssetBuffer(asset, size) const data = await immich.getAssetBuffer(asset, size)
if (data) { if (data) {
for (const header of ['content-type', 'content-length']) { for (const header of ['content-type', 'content-length']) {
res.set(header, data.headers[header]) res.set(header, data.headers.get(header))
} }
res.send(Buffer.from(await data.arrayBuffer())) res.send(Buffer.from(await data.arrayBuffer()))
} else { } else {