Skip to content

fix(mime): prefer video/mp4 for .mp4 and image/x-icon for .ico#11132

Merged
mjackson merged 2 commits intoremix-run:mainfrom
mitre88:fix/mime-type-preferences
Apr 24, 2026
Merged

fix(mime): prefer video/mp4 for .mp4 and image/x-icon for .ico#11132
mjackson merged 2 commits intoremix-run:mainfrom
mitre88:fix/mime-type-preferences

Conversation

@mitre88
Copy link
Copy Markdown
Contributor

@mitre88 mitre88 commented Mar 6, 2026

Summary

Add preferred MIME type overrides in the codegen for extensions where the algorithm picks an uncommon type:

  • mp4: application/mp4video/mp4 per RFC 4337 §2 which specifies video/mp4 as the general-purpose type
  • ico: image/vnd.microsoft.iconimage/x-icon which is the historically used type by Microsoft and browsers

Changes

  • packages/mime/scripts/codegen.ts: Add preferredOverrides map applied after the main algorithm
  • packages/mime/src/generated/mime-types.ts: Updated generated output
  • packages/mime/src/lib/detect-mime-type.test.ts: Updated test expectation

Fixes #11106
Fixes #11107

Add preferred MIME type overrides in codegen for extensions where the
algorithm picks an uncommon type:

- mp4: application/mp4 → video/mp4 (RFC 4337 §2)
- ico: image/vnd.microsoft.icon → image/x-icon (historical standard)

Fixes remix-run#11106
Fixes remix-run#11107
@MichaelDeBoey MichaelDeBoey changed the title fix(mime): prefer video/mp4 for .mp4 and image/x-icon for .ico fix(mime): prefer video/mp4 for .mp4 and image/x-icon for .ico Mar 25, 2026
@mitre88
Copy link
Copy Markdown
Contributor Author

mitre88 commented Apr 13, 2026

Gentle ping — this fix ensures correct MIME types for .mp4 and .ico files. The change is minimal and well-scoped. Would appreciate a review when possible. Thanks!

@mjackson mjackson merged commit d9f2354 into remix-run:main Apr 24, 2026
9 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.

[mime] ico resolves to image/vnd.microsoft.icon instead of image/x-icon [mime] mp4 resolves to application/mp4 instead of video/mp4

2 participants