From e3a60ec9df5797b9fb084fa70a56d1e044b8a462 Mon Sep 17 00:00:00 2001 From: Alan Grainger Date: Sun, 17 Nov 2024 08:43:27 +0100 Subject: [PATCH] Add CORS header to default config --- app/config.json | 3 ++- app/package.json | 2 +- app/src/index.ts | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/config.json b/app/config.json index 76aecaf..e1696a6 100644 --- a/app/config.json +++ b/app/config.json @@ -1,7 +1,8 @@ { "ipp": { "responseHeaders": { - "Cache-Control": "public, max-age=2592000" + "Cache-Control": "public, max-age=2592000", + "Access-Control-Allow-Origin": "*" }, "singleImageGallery": false, "singleItemAutoOpen": true, diff --git a/app/package.json b/app/package.json index f10f231..e01ba47 100644 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "immich-public-proxy", - "version": "1.4.5", + "version": "1.4.6", "scripts": { "dev": "ts-node src/index.ts", "build": "npx tsc", diff --git a/app/src/index.ts b/app/src/index.ts index a5db9db..29a6a7d 100644 --- a/app/src/index.ts +++ b/app/src/index.ts @@ -117,6 +117,7 @@ app.get('/healthcheck', async (_req, res) => { * reverse proxy config, or even redirect to 404 if you like. */ app.get('/', (_req, res) => { + addResponseHeaders(res) res.render('home') })