mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-07-02 04:12:36 +00:00
📧 fix: Add .eml (message/rfc822) Support to File Upload (#13989)
* fix: add .eml (message/rfc822) support to file upload * chore: restore package lock metadata --------- Co-authored-by: Malte Polley <ahabsfriend@posteo.de> Co-authored-by: Danny Avila <danny@librechat.ai>
This commit is contained in:
parent
b20abb2593
commit
e88f7a8f19
2 changed files with 21 additions and 0 deletions
|
|
@ -66,6 +66,19 @@ describe('inferMimeType', () => {
|
|||
it('should reject raw text/x-markdown without normalization', () => {
|
||||
expect(baseFileConfig.checkType('text/x-markdown')).toBe(false);
|
||||
});
|
||||
|
||||
it('should infer message/rfc822 from extension when browser type is empty', () => {
|
||||
expect(inferMimeType('email.eml', '')).toBe('message/rfc822');
|
||||
});
|
||||
|
||||
it('should pass through message/rfc822 when browser reports it', () => {
|
||||
expect(inferMimeType('email.eml', 'message/rfc822')).toBe('message/rfc822');
|
||||
});
|
||||
|
||||
it('should produce a type accepted by checkType for .eml files', () => {
|
||||
const normalized = inferMimeType('test.eml', '');
|
||||
expect(baseFileConfig.checkType(normalized)).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe('applicationMimeTypes', () => {
|
||||
|
|
@ -148,6 +161,10 @@ describe('supportedMimeTypes', () => {
|
|||
])('ODF type flows through supportedMimeTypes: %s', (mimeType) => {
|
||||
expect(checkSupported(mimeType)).toBe(true);
|
||||
});
|
||||
|
||||
it('message/rfc822 (.eml) flows through supportedMimeTypes', () => {
|
||||
expect(checkSupported('message/rfc822')).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe('documentParserMimeTypes', () => {
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ export const fullMimeTypesList = [
|
|||
'application/vnd.oasis.opendocument.graphics',
|
||||
'image/svg',
|
||||
'image/svg+xml',
|
||||
'message/rfc822',
|
||||
// Video formats
|
||||
'video/mp4',
|
||||
'video/avi',
|
||||
|
|
@ -228,6 +229,8 @@ export const supportedMimeTypes = [
|
|||
audioMimeTypes,
|
||||
/** Supported by LC Code Interpreter API */
|
||||
/^image\/(svg|svg\+xml)$/,
|
||||
/** .eml email files */
|
||||
/^message\/rfc822$/,
|
||||
];
|
||||
|
||||
export const codeInterpreterMimeTypes = [
|
||||
|
|
@ -284,6 +287,7 @@ export const codeTypeMapping: { [key: string]: string } = {
|
|||
cljs: 'text/plain', // .cljs - ClojureScript source
|
||||
cljc: 'text/plain', // .cljc - Clojure common source
|
||||
elm: 'text/plain', // .elm - Elm source
|
||||
eml: 'message/rfc822', // .eml - Email message (RFC 822)
|
||||
erl: 'text/plain', // .erl - Erlang source
|
||||
hrl: 'text/plain', // .hrl - Erlang header
|
||||
ex: 'text/plain', // .ex - Elixir source
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue