Skip to content

fix: add audio/flac to commonBinaryMimeTypes #671

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 11, 2024

Conversation

davidjoy
Copy link
Contributor

This commit adds audio/flac to the commonBinaryMimeTypes 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#flac

For 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 in open-next/src/core/routing/utils.ts. I've temporarily set my Content-Type to application/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!

This commit adds audio/flac to the commonBinaryMimeTypes 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#flac
Copy link

changeset-bot bot commented Dec 11, 2024

🦋 Changeset detected

Latest commit: e922497

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@opennextjs/aws Patch
app-pages-router Patch
app-router Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

pkg-pr-new bot commented Dec 11, 2024

Open in Stackblitz

pnpm add https://pkg.pr.new/@opennextjs/aws@671

commit: e922497

Copy link
Contributor

@conico974 conico974 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Thanks

@conico974 conico974 merged commit 44392ba into opennextjs:main Dec 11, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants