Skip to content

📑 fix: Alias Mimetype text/x-markdown to text/markdown#12608

Merged
danny-avila merged 1 commit into
danny-avila:devfrom
newjersey:dlew/x-markdown-mime-type-alias
Apr 11, 2026
Merged

📑 fix: Alias Mimetype text/x-markdown to text/markdown#12608
danny-avila merged 1 commit into
danny-avila:devfrom
newjersey:dlew/x-markdown-mime-type-alias

Conversation

@dlew

@dlew dlew commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

Summary

text/x-markdown is a deprecated version of a markdown mimetype, but we're seeing that sometimes users still send this mimetype. This change allows these files to be uploaded as text/markdown.

Change Type

  • Bug fix (non-breaking change which fixes an issue)

Testing

I added unit tests to verify that the inferMimeType() function will work correctly with text/x-markdown.

Checklist

Please delete any irrelevant options.

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes

text/x-markdown is a deprecated version of a markdown mimetype, but
we're seeing that sometimes users still send this mimetype. This
change allows these files to be uploaded as text/markdown.
@danny-avila danny-avila changed the title fix: alias mimetype text/x-markdown to text/markdown 📑 fix: Alias Mimetype text/x-markdown to text/markdown Apr 11, 2026
@danny-avila danny-avila merged commit b1fee80 into danny-avila:dev Apr 11, 2026
13 checks passed
jona7o added a commit to innFactory/ai-chat-base that referenced this pull request Apr 12, 2026
Use getFileExtensionFromMime() to normalize non-standard MIME types
(e.g. audio/x-m4a, audio/x-wav, audio/x-flac) before checking against
the accepted formats list in azureOpenAIProvider. This is the same class
of bug as danny-avila#12608 (text/x-markdown), but for STT audio validation.

Only audio/ and video/ MIME prefixes are normalized to prevent
non-audio types from matching via the webm default fallback.

Export getFileExtensionFromMime for testability.

Fixes danny-avila#12632
yidianyiko pushed a commit to yidianyiko/LibreChat that referenced this pull request Apr 13, 2026
…la#12608)

text/x-markdown is a deprecated version of a markdown mimetype, but
we're seeing that sometimes users still send this mimetype. This
change allows these files to be uploaded as text/markdown.
danny-avila added a commit that referenced this pull request Apr 15, 2026
* fix: normalize audio MIME types in STT format validation

Use getFileExtensionFromMime() to normalize non-standard MIME types
(e.g. audio/x-m4a, audio/x-wav, audio/x-flac) before checking against
the accepted formats list in azureOpenAIProvider. This is the same class
of bug as #12608 (text/x-markdown), but for STT audio validation.

Only audio/ and video/ MIME prefixes are normalized to prevent
non-audio types from matching via the webm default fallback.

Export getFileExtensionFromMime for testability.

Fixes #12632

* fix: reject unknown audio subtypes in STT format validation

Use MIME_TO_EXTENSION_MAP for normalization instead of
getFileExtensionFromMime() which falls back to 'webm' for unrecognized
types. Gate raw subtype matching on audio/video prefix to prevent
non-audio types (e.g. text/webm) from passing validation.

Resolves Codex review comment about unknown subtypes silently passing.

---------

Co-authored-by: Tobias Jonas <t.jonas@innfactory.de>
@dlew dlew deleted the dlew/x-markdown-mime-type-alias branch April 15, 2026 15:59
krgokul pushed a commit to syedhabib39/LibreChat that referenced this pull request Apr 20, 2026
…la#12674)

* fix: normalize audio MIME types in STT format validation

Use getFileExtensionFromMime() to normalize non-standard MIME types
(e.g. audio/x-m4a, audio/x-wav, audio/x-flac) before checking against
the accepted formats list in azureOpenAIProvider. This is the same class
of bug as danny-avila#12608 (text/x-markdown), but for STT audio validation.

Only audio/ and video/ MIME prefixes are normalized to prevent
non-audio types from matching via the webm default fallback.

Export getFileExtensionFromMime for testability.

Fixes danny-avila#12632

* fix: reject unknown audio subtypes in STT format validation

Use MIME_TO_EXTENSION_MAP for normalization instead of
getFileExtensionFromMime() which falls back to 'webm' for unrecognized
types. Gate raw subtype matching on audio/video prefix to prevent
non-audio types (e.g. text/webm) from passing validation.

Resolves Codex review comment about unknown subtypes silently passing.

---------

Co-authored-by: Tobias Jonas <t.jonas@innfactory.de>
krgokul pushed a commit to syedhabib39/LibreChat that referenced this pull request Apr 21, 2026
…la#12674)

* fix: normalize audio MIME types in STT format validation

Use getFileExtensionFromMime() to normalize non-standard MIME types
(e.g. audio/x-m4a, audio/x-wav, audio/x-flac) before checking against
the accepted formats list in azureOpenAIProvider. This is the same class
of bug as danny-avila#12608 (text/x-markdown), but for STT audio validation.

Only audio/ and video/ MIME prefixes are normalized to prevent
non-audio types from matching via the webm default fallback.

Export getFileExtensionFromMime for testability.

Fixes danny-avila#12632

* fix: reject unknown audio subtypes in STT format validation

Use MIME_TO_EXTENSION_MAP for normalization instead of
getFileExtensionFromMime() which falls back to 'webm' for unrecognized
types. Gate raw subtype matching on audio/video prefix to prevent
non-audio types (e.g. text/webm) from passing validation.

Resolves Codex review comment about unknown subtypes silently passing.

---------

Co-authored-by: Tobias Jonas <t.jonas@innfactory.de>
OnyxBishop pushed a commit to OnyxBishop/LibreChat that referenced this pull request Apr 22, 2026
…la#12608)

text/x-markdown is a deprecated version of a markdown mimetype, but
we're seeing that sometimes users still send this mimetype. This
change allows these files to be uploaded as text/markdown.
jcbartle pushed a commit to jcbartle/LibreChat that referenced this pull request May 11, 2026
…la#12608)

text/x-markdown is a deprecated version of a markdown mimetype, but
we're seeing that sometimes users still send this mimetype. This
change allows these files to be uploaded as text/markdown.
jcbartle pushed a commit to jcbartle/LibreChat that referenced this pull request May 11, 2026
…la#12674)

* fix: normalize audio MIME types in STT format validation

Use getFileExtensionFromMime() to normalize non-standard MIME types
(e.g. audio/x-m4a, audio/x-wav, audio/x-flac) before checking against
the accepted formats list in azureOpenAIProvider. This is the same class
of bug as danny-avila#12608 (text/x-markdown), but for STT audio validation.

Only audio/ and video/ MIME prefixes are normalized to prevent
non-audio types from matching via the webm default fallback.

Export getFileExtensionFromMime for testability.

Fixes danny-avila#12632

* fix: reject unknown audio subtypes in STT format validation

Use MIME_TO_EXTENSION_MAP for normalization instead of
getFileExtensionFromMime() which falls back to 'webm' for unrecognized
types. Gate raw subtype matching on audio/video prefix to prevent
non-audio types (e.g. text/webm) from passing validation.

Resolves Codex review comment about unknown subtypes silently passing.

---------

Co-authored-by: Tobias Jonas <t.jonas@innfactory.de>
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