🗂️ fix: Disable express-static-gzip for Uploaded Images (#8307)

* Fix scanning of the uploaded images folder on startup

* Re-write tests to pass linting

* Disable image output gzip scan by default

* Add `ENABLE_IMAGE_OUTPUT_GZIP_SCAN` to `.env.example`
This commit is contained in:
Sebastien Bruel 2025-07-12 05:51:53 +09:00 committed by GitHub
parent d2e1ca4c4a
commit 9f44187351
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 620 additions and 32 deletions

View file

@ -1,8 +1,11 @@
const express = require('express');
const staticCache = require('../utils/staticCache');
const paths = require('~/config/paths');
const { isEnabled } = require('~/server/utils');
const skipGzipScan = !isEnabled(process.env.ENABLE_IMAGE_OUTPUT_GZIP_SCAN);
const router = express.Router();
router.use(staticCache(paths.imageOutput));
router.use(staticCache(paths.imageOutput, { skipGzipScan }));
module.exports = router;