Skip to content

Commit 701600a

Browse files
committed
Normalize MIME-types we invented with /x-ft- prefix
MIME-types we invented, which neither have a widely used existing MIME-type, to use the `/x-ft-` prefix. These MIME-type mappings changed: - `application/x-lzip` ↦ `application/lzip` - `application/x.ms.shortcut` ↦ `application/x-ms-shortcut` - `application/x.apple.alias` ↦ `application/x-ft-apple.alias` - `application/x.autodesk.fbx` ↦ `application/x-ft-fbx` - `application/vnd.google.draco` ↦ `application/x-ft-draco`
1 parent f8d62be commit 701600a

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

core.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ export class FileTypeParser {
723723
if (this.checkString('LZIP')) {
724724
return {
725725
ext: 'lz',
726-
mime: 'application/x-lzip',
726+
mime: 'application/lzip',
727727
};
728728
}
729729

@@ -943,7 +943,7 @@ export class FileTypeParser {
943943
if (this.check([0x04, 0x22, 0x4D, 0x18])) {
944944
return {
945945
ext: 'lz4',
946-
mime: 'application/x-lz4', // Invented by us
946+
mime: 'application/x-lz4',
947947
};
948948
}
949949

@@ -1056,7 +1056,7 @@ export class FileTypeParser {
10561056
if (this.checkString('DRACO')) {
10571057
return {
10581058
ext: 'drc',
1059-
mime: 'application/vnd.google.draco', // Invented by us
1059+
mime: 'application/x-ft-draco',
10601060
};
10611061
}
10621062

@@ -1616,21 +1616,21 @@ export class FileTypeParser {
16161616
if (this.check([0x4C, 0x00, 0x00, 0x00, 0x01, 0x14, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46])) {
16171617
return {
16181618
ext: 'lnk',
1619-
mime: 'application/x.ms.shortcut', // Invented by us
1619+
mime: 'application/x-ms-shortcut', // Informal, used by freedesktop.org. shared-mime-info
16201620
};
16211621
}
16221622

16231623
if (this.check([0x62, 0x6F, 0x6F, 0x6B, 0x00, 0x00, 0x00, 0x00, 0x6D, 0x61, 0x72, 0x6B, 0x00, 0x00, 0x00, 0x00])) {
16241624
return {
16251625
ext: 'alias',
1626-
mime: 'application/x.apple.alias', // Invented by us
1626+
mime: 'application/x-ft-apple.alias',
16271627
};
16281628
}
16291629

16301630
if (this.checkString('Kaydara FBX Binary \u0000')) {
16311631
return {
16321632
ext: 'fbx',
1633-
mime: 'application/x.autodesk.fbx', // Invented by us
1633+
mime: 'application/x-ft-fbx',
16341634
};
16351635
}
16361636

supported.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@ export const extensions = [
179179
'dat',
180180
];
181181

182+
/**
183+
MIME media subtype prefixed with x-ft-, are invented by us.
184+
These types like formal IANA/RFC registration, neither an existing widely used convention
185+
*/
182186
export const mimeTypes = [
183187
'image/jpeg',
184188
'image/png',
@@ -260,7 +264,7 @@ export const mimeTypes = [
260264
'application/x-unix-archive',
261265
'application/x-rpm',
262266
'application/x-compress',
263-
'application/x-lzip',
267+
'application/lzip',
264268
'application/x-cfb',
265269
'application/x-mie',
266270
'application/mxf',
@@ -288,9 +292,9 @@ export const mimeTypes = [
288292
'text/vtt',
289293
'model/gltf-binary',
290294
'application/vnd.tcpdump.pcap',
291-
'audio/x-dsf', // Non-standard
292-
'application/x.ms.shortcut', // Invented by us
293-
'application/x.apple.alias', // Invented by us
295+
'audio/x-dsf', // Informal
296+
'application/x-ms-shortcut', // Informal, used by freedesktop.org. shared-mime-info
297+
'application/x-ft-apple.alias',
294298
'audio/x-voc',
295299
'audio/vnd.dolby.dd-raw',
296300
'audio/x-m4a',
@@ -330,10 +334,10 @@ export const mimeTypes = [
330334
'application/x-ace-compressed',
331335
'application/avro',
332336
'application/vnd.iccprofile',
333-
'application/x.autodesk.fbx', // Invented by us
337+
'application/x-ft-fbx',
334338
'application/vnd.visio',
335339
'application/vnd.android.package-archive',
336-
'application/vnd.google.draco', // Invented by us
340+
'application/x-ft-draco',
337341
'application/x-lz4', // Invented by us
338342
'application/vnd.openxmlformats-officedocument.presentationml.template',
339343
'application/vnd.openxmlformats-officedocument.spreadsheetml.template',

0 commit comments

Comments
 (0)