Skip to content

Commit

Permalink
Merge pull request #242 from sakura1977/RFC-9239
Browse files Browse the repository at this point in the history
Follow RFC 9239 mime type definitions.
  • Loading branch information
synopse committed Mar 1, 2024
2 parents 073eba6 + ee6f7fc commit c53dbd9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/core/mormot.core.buffers.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1739,7 +1739,7 @@ function IncludeTrailingUriDelimiter(const URI: RawByteString): RawByteString;
'text/css', // mtCss
'application/javascript', // mtJS
'image/x-icon', // mtXIcon
'application/font-woff', // mtFont
'text/font-woff', // mtFont
TEXT_CONTENT_TYPE, // mtText
'image/svg+xml', // mtSvg
XML_CONTENT_TYPE, // mtXml
Expand Down Expand Up @@ -8681,20 +8681,20 @@ function GetMimeContentTypeFromBuffer(Content: Pointer; Len: PtrInt;
end;

const
MIME_EXT: array[0..45] of PUtf8Char = ( // for IdemPPChar() start check
MIME_EXT: array[0..46] of PUtf8Char = ( // for IdemPPChar() start check
'PNG', 'GIF', 'TIF', 'JP', 'BMP', 'DOC', 'HTM', 'CSS',
'JSON', 'ICO', 'WOF', 'TXT', 'SVG', 'ATOM', 'RDF', 'RSS',
'WEBP', 'APPC', 'MANI', 'XML', 'JS', 'WOFF', 'OGG',
'WEBP', 'APPC', 'MANI', 'XML', 'JS', 'MJS', 'WOFF', 'OGG',
'OGV', 'MP4', 'M2V', 'M2P', 'MP3', 'H264', 'TEXT', 'LOG',
'GZ', 'WEBM', 'MKV', 'RAR', '7Z', 'BZ2', 'WMA', 'WMV',
'AVI', 'PPT', 'XLS', 'PDF', 'SQLITE', 'DB3', nil);
MIME_EXT_TYPE: array[0 .. high(MIME_EXT) - 1] of TMimeType = (
mtPng, mtGif, mtTiff, mtJpg, mtBmp, mtDoc, mtHtml, mtCss,
mtJson, mtXIcon, mtFont, mtText, mtSvg, mtXml, mtXml, mtXml,
mtWebp, mtManifest, mtManifest, mtXml, mtJS, mtFont, mtOgg,
mtOgg, mtMp4, mtMp2, mtMp2, mtMpeg, mtH264, mtText, mtText,
mtGzip, mtWebm, mtWebm, mtRar, mt7z, mtBz2, mtWma, mtWmv,
mtAvi, mtPpt, mtXls, mtPdf, mtSQlite3, mtSQlite3);
mtWebp, mtManifest, mtManifest, mtXml, mtJS, mtJS, mtFont,
mtOgg, mtOgg, mtMp4, mtMp2, mtMp2, mtMpeg, mtH264, mtText,
mtText, mtGzip, mtWebm, mtWebm, mtRar, mt7z, mtBz2, mtWma,
mtWmv, mtAvi, mtPpt, mtXls, mtPdf, mtSQlite3, mtSQlite3);

function GetMimeTypeFromExt(const Ext: RawUtf8): TMimeType;
var
Expand Down

0 comments on commit c53dbd9

Please sign in to comment.