From da5930fab1576451106f88780462c6006d9ddd60 Mon Sep 17 00:00:00 2001 From: Alan Grainger Date: Sun, 3 Nov 2024 11:22:38 +0100 Subject: [PATCH] Fix #11 image headers being sent as 'undefined' --- Dockerfile | 13 ++++++------- app/package.json | 2 +- app/src/render.ts | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4bca447..0bf58ac 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,12 +2,15 @@ FROM node:lts-slim WORKDIR /app -COPY app/package.json ./ +COPY app/ ./ -RUN npm install --omit=dev RUN npm install pm2 -g -COPY app/ ./ +RUN chown -R node:node /app + +USER node + +RUN npm install --omit=dev ENV NODE_ENV=production @@ -15,10 +18,6 @@ ENV NODE_ENV=production # dev-dependencies above to save space in the final build 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 CMD ["pm2-runtime", "dist/index.js" ] diff --git a/app/package.json b/app/package.json index 3edb34a..ac380ad 100644 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "immich-public-proxy", - "version": "1.3.4", + "version": "1.3.5", "scripts": { "dev": "ts-node src/index.ts", "build": "npx tsc", diff --git a/app/src/render.ts b/app/src/render.ts index 58a1ec5..43da334 100644 --- a/app/src/render.ts +++ b/app/src/render.ts @@ -17,7 +17,7 @@ class Render { const data = await immich.getAssetBuffer(asset, size) if (data) { 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())) } else {