fix(scanner): normalize Epson collection separators
All checks were successful
Build and Release FEDEO / verify (push) Successful in 55s
Build and Release FEDEO / build-and-release (push) Successful in 6m0s

This commit is contained in:
2026-09-30 19:10:59 +02:00
parent b585b972f2
commit 2143ce0933
3 changed files with 25 additions and 2 deletions

View File

@@ -26,7 +26,9 @@ export default async function scannerInboxGateway(server: FastifyInstance, optio
const handle = async (req: FastifyRequest, reply: any) => {
const identity = identities.get(req)!
const filename = (req.params as { "*"?: string })["*"] || ""
// Epson appends its own separator even when the configured inbox URL ends in '/'.
// Remove only extra separators at the collection boundary, not within filenames.
const filename = ((req.params as { "*"?: string })["*"] || "").replace(/^\/+/, "")
if (filename && (filename.length > 200 || filename.startsWith(".") || /[\\/\u0000-\u001f\u007f]/.test(filename))) {
throw scannerError(400, "Unterordner und ungültige Dateinamen werden nicht unterstützt.")
}