From 30e102047f58dbf08db18db55186edaa7a6296ac Mon Sep 17 00:00:00 2001 From: astrid Date: Fri, 19 Jul 2024 01:43:25 +0200 Subject: [PATCH] fix scrubbing for audio as well --- src/server/decorators/dbFile.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/decorators/dbFile.ts b/src/server/decorators/dbFile.ts index b37d3fc04..d7fd2f91e 100644 --- a/src/server/decorators/dbFile.ts +++ b/src/server/decorators/dbFile.ts @@ -21,7 +21,7 @@ function dbFileDecorator(fastify: FastifyInstance, _, done) { this.header('Content-Length', size); this.header('Content-Type', download ? 'application/octet-stream' : file.mimetype); this.header('Content-Disposition', `inline; filename="${encodeURI(file.originalName || file.name)}"`); - if (file.mimetype.startsWith('video/')) { + if (file.mimetype.startsWith('video/') || file.mimetype.startsWith('audio/')) { this.header('Accept-Ranges', 'bytes'); // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range this.header('Content-Range', `bytes 0-${size - 1}/${size}`);