Skip to content

Commit

Permalink
fix scrubbing for audio as well
Browse files Browse the repository at this point in the history
  • Loading branch information
ari-party committed Jul 18, 2024
1 parent d2da4a5 commit 30e1020
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/server/decorators/dbFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand Down

0 comments on commit 30e1020

Please sign in to comment.