diff --git a/README.md b/README.md index d1b3c29..9cc5859 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@

- Docker pulls + Docker pulls - Latest release + Latest release Open demo gallery

diff --git a/app/package.json b/app/package.json index 925f113..bad40ba 100644 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "immich-public-proxy", - "version": "1.7.0", + "version": "1.7.1", "scripts": { "dev": "ts-node src/index.ts", "build": "npx tsc", diff --git a/app/src/immich.ts b/app/src/immich.ts index 1d3601b..4163869 100644 --- a/app/src/immich.ts +++ b/app/src/immich.ts @@ -43,9 +43,6 @@ class Immich { * 404 - any other failed request. Check console.log for details. */ async handleShareRequest (request: IncomingShareRequest, res: Response) { - // Add the headers configured in config.json (most likely `cache-control`) - addResponseHeaders(res) - // Check that the key is a valid format if (!immich.isKey(request.key)) { log('Invalid share key ' + request.key) @@ -73,6 +70,9 @@ class Immich { if (sharedLinkRes.passwordRequired) { // `request.key` is already sanitised at this point, but it never hurts to be explicit const key = request.key.replace(/[^\w-]/g, '') + res.header('Cache-Control', 'no-store, no-cache, must-revalidate, proxy-revalidate') + res.header('Pragma', 'no-cache') + res.header('Expires', '0') res.render('password', { key, lgConfig: render.lgConfig, @@ -96,6 +96,7 @@ class Immich { } // Everything is ok - output the shared link data + addResponseHeaders(res) if (request.mode === 'download' && getConfigOption('ipp.allowDownloadAll', false)) { // Download all assets as a zip file diff --git a/app/src/index.ts b/app/src/index.ts index 7b81d11..7c566c4 100644 --- a/app/src/index.ts +++ b/app/src/index.ts @@ -35,6 +35,8 @@ app.use(express.json()) app.use('/share/static', express.static('public', { setHeaders: addResponseHeaders })) // Serve the same assets on /, to allow for /robots.txt and /favicon.ico app.use(express.static('public', { setHeaders: addResponseHeaders })) +// Remove the X-Powered-By ExpressJS header +app.disable('x-powered-by') /** * Middleware to decode the encrypted data stored in the session cookie