Conversation
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.
|
yottanami
marked this pull request as ready for review
October 4, 2026 03:27
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #12468.
Firefox gives
.oggfiles the MIME typeapplication/ogg, notaudio/ogg(its built-in table mapsoggtoapplication/ogg, and listsvideo/oggforogv,oggtoo). 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 allowsogg.This widens
ALLOWED_AUDIO_FILE_MIMEinpackages/common/src/utils/uploadConstants.tsto/^(audio|video\/ogg|application\/ogg)/, which bothprocessFiles(web) andprocessTrackFile(mobile) use, and addsuploadConstants.test.ts.What a real Firefox reports, from headless Firefox 157 with an
<input type=file>and files encoded by ffmpeg: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 installas in CI:npx turbo run typecheck --filter=@audius/web: 6/6 tasks successful.npm run verifyinpackages/common: the same 4 prettier errors as onmain, 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, theapplication/ogg/video/oggcase fails.packages/commontypecheck (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.