return 404 when /media not found

This commit is contained in:
lesion 2022-05-02 16:47:56 +02:00
parent fcd28dca3a
commit 3fb4970ec5
No known key found for this signature in database
GPG key ID: 352918250B012177

View file

@ -95,8 +95,8 @@ module.exports = {
serveStatic () {
const router = express.Router()
// serve event's images/thumb
router.use('/media/', express.static(config.upload_path, { immutable: true, maxAge: '1y' } ))
// serve images/thumb
router.use('/media/', express.static(config.upload_path, { immutable: true, maxAge: '1y' } ), (_req, res) => res.sendStatus(404))
router.use('/noimg.svg', express.static('./static/noimg.svg'))
router.use('/logo.png', (req, res, next) => {