fix: add audio/flac to commonBinaryMimeTypes #671
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit adds
audio/flac
to thecommonBinaryMimeTypes
Set.Mozilla lists
audio/flac
as a valid media container format in their documentation: https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Containers#flacFor my part, I was creating a route handler in my Next.js app (built with SST and opennextjs-aws) that was returning an FLAC file passed through from an S3 bucket. The file is supposed to be played in the client using an Web Audio AudioContext.
I was mystified why the file size was different than expected when it was returned to the client to be played, and after digging around found that the
isBase64Encoded
response parameter was likely being set to true inopen-next/src/core/routing/utils.ts
. I've temporarily set myContent-Type
toapplication/octet-stream
to fix the issue, but it's not a perfect solution (since the client can't then tell the "file" from my API route endpoint is actually a FLAC file.)Anyway, I expect audio/flac shouldn't be a terribly controversial addition, and would also love to get rid of my workaround for my users. Thanks!