Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

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

Daniel Lewb1fee80de4d5
diff --git a/packages/data-provider/src/file-config.spec.ts b/packages/data-provider/src/file-config.spec.ts
index ee894712ff..ec846af5a4 100644
--- a/packages/data-provider/src/file-config.spec.ts
+++ b/packages/data-provider/src/file-config.spec.ts
@@ -19,6 +19,10 @@ describe('inferMimeType', () => {
expect(inferMimeType('test.py', 'text/x-python-script')).toBe('text/x-python');
});
+ it('should normalize text/x-markdown to text/markdown', () => {
+ expect(inferMimeType('test.md', 'text/x-markdown')).toBe('text/markdown');
+ });
+
it('should return a type that matches textMimeTypes after normalization', () => {
const normalized = inferMimeType('test.py', 'text/x-python-script');
expect(textMimeTypes.test(normalized)).toBe(true);
@@ -45,9 +49,18 @@ describe('inferMimeType', () => {
expect(baseFileConfig.checkType(normalized)).toBe(true);
});
+ it('should produce a type accepted by checkType after normalizing text/x-markdown', () => {
+ const normalized = inferMimeType('test.md', 'text/x-markdown');
+ expect(baseFileConfig.checkType(normalized)).toBe(true);
+ });
+
it('should reject raw text/x-python-script without normalization', () => {
expect(baseFileConfig.checkType('text/x-python-script')).toBe(false);
});
+
+ it('should reject raw text/x-markdown without normalization', () => {
+ expect(baseFileConfig.checkType('text/x-markdown')).toBe(false);
+ });
});
describe('applicationMimeTypes', () => {
diff --git a/packages/data-provider/src/file-config.ts b/packages/data-provider/src/file-config.ts
index a93daf79e2..2a29b46943 100644
--- a/packages/data-provider/src/file-config.ts
+++ b/packages/data-provider/src/file-config.ts
@@ -362,6 +362,7 @@ export const imageTypeMapping: { [key: string]: string } = {
/** Normalizes non-standard MIME types that browsers may report to their canonical forms */
export const mimeTypeAliases: Readonly<Record<string, string>> = {
'text/x-python-script': 'text/x-python',
+ 'text/x-markdown': 'text/markdown',
};
/**