Skip to content

fix(upload): accept Ogg files that browsers report as application/ogg - #14617

Open
yottanami wants to merge 1 commit into
AudiusProject:mainfrom
yottanami:agent/133-ogg-mime-fix
Open

yottanami wants to merge 1 commit into
AudiusProject:mainfrom
yottanami:agent/133-ogg-mime-fix

Conversation

@yottanami

Copy link
Copy Markdown

Fixes #12468.

Firefox gives .ogg files the MIME type application/ogg, not audio/ogg (its built-in table maps ogg to application/ogg, and lists video/ogg for ogv,ogg too). Upload validation only accepts types matching /^audio/, so on web the file is rejected with "Unsupported File Type" before it ever reaches a validator node. The extension check already allows ogg.

This widens ALLOWED_AUDIO_FILE_MIME in packages/common/src/utils/uploadConstants.ts to /^(audio|video\/ogg|application\/ogg)/, which both processFiles (web) and processTrackFile (mobile) use, and adds uploadConstants.test.ts.

What a real Firefox reports, from headless Firefox 157 with an <input type=file> and files encoded by ffmpeg:

tone.ogg   file.type = 'application/ogg'   rejected by /^audio/, accepted after this change
tone.oga   file.type = 'audio/ogg'
tone.opus  file.type = 'audio/ogg'
tone.mp3   file.type = 'audio/mpeg'

The comment next to the check in both callers says the backend matches the MIME type again. The validator node's upload handlers and transcode code (OpenAudio/go-openaudio, pkg/mediorum/server/serve_upload*.go, transcode.go) have no MIME-type rejection; audio uploads go to ffprobe/ffmpeg, which read Ogg. That's from reading the code, not from running a node.

Checks, run with npm 11.10.0 and a full npm ci || npm install as in CI:

  • npx turbo run typecheck --filter=@audius/web: 6/6 tasks successful.
  • npm run verify in packages/common: the same 4 prettier errors as on main, in files this doesn't touch (useTrackPageLineup.ts, WalletClient.ts, audio-rewards/selectors.ts, storeContext.ts); nothing in the two changed files.
  • npx vitest run src/utils/uploadConstants.test.ts: 3 passed; with the old regex, the application/ogg/video/ogg case fails.
  • packages/common typecheck (tsc --noEmit): clean.

Mobile uses the same constant, but this wasn't run on an iOS or Android device.

Written with an AI coding assistant (Claude Code). The diff was reviewed and the checks above passed before submission.

Firefox's built-in extension table gives .ogg files the type
application/ogg (and lists video/ogg for them too), so web upload
rejected them with "Unsupported File Type" even though ogg is an
allowed extension. Widen ALLOWED_AUDIO_FILE_MIME to those two types and
add tests.
@changeset-bot

changeset-bot Bot commented Oct 4, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: fe0670a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@yottanami
yottanami marked this pull request as ready for review October 4, 2026 03:27

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[API/SDK BUG] Unsupported ogg file format

1 participant