fix(scanner): normalize Epson collection separators
This commit is contained in:
@@ -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.")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user