IndySockets / Indy

Indy - Internet Direct
https://www.indyproject.org
455 stars 155 forks source link

TIdMimeTable can't handle duplicate file extensions to different media types #485

Open rlebeau opened 1 year ago

rlebeau commented 1 year ago

TIdMimeTable.BuildDefaultCache() calls FillMimeTable() to fill a local TStringList with default extensions and mime types. There are multiple duplicate extensions in this list, specifically:

.asf=video/x-ms-asf .asf=application/vnd.ms-asf

.asx=video/x-ms-asf .asx=video/x-ms-asf-plugin

.cpt=application/mac-compactpro .cpt=image/x-corelphotopaint

.m3u=audio/mpegurl .m3u=audio/x-mpegurl

.mp2=audio/x-mpg .mp2=video/mpeg

.mp3=audio/x-mpg .mp3=video/mpeg

.rdf=application/rdf+xml twice

.rm=application/vnd.rn-realmedia .rm=audio/x-pn-realaudio

.rss=application/rss+xml twice

.wbmp=image/vnd.wap.wbmp twice

.xml=text/xml twice

Multiple media types can be mapped to the same file extension, but a file extension can't be mapped to multiple media types. So TIdMimeTable needs to be updated to handle this better.

rlebeau commented 1 year ago

Related: #238