Refactor to a response function (no WET code)

This commit is contained in:
Alan Grainger
2025-03-07 13:00:41 +08:00
parent 01c3236e0f
commit 9e176e816a
5 changed files with 43 additions and 31 deletions
+2 -4
View File
@@ -3,6 +3,7 @@ import { Response } from 'express-serve-static-core'
import { Asset, AssetType, ImageSize, IncomingShareRequest, SharedLink } from './types'
import { getConfigOption } from './functions'
import archiver from 'archiver'
import { respondToInvalidRequest } from './invalidRequestHandler'
class Render {
lgConfig
@@ -74,10 +75,7 @@ class Render {
)
res.end()
} else {
if (getConfigOption('ipp.stealthMode', true)) {
res.destroy();
}
res.status(404).send()
respondToInvalidRequest(res, 404)
}
}