Skip to content
This repository was archived by the owner on Nov 22, 2018. It is now read-only.

Commit 545fa9e

Browse files
committed
Added MIME Types
Added the following MIME types which I have found to be missing: .json - application/json (This one is pretty unbelievable) .ttc - application/x-font-ttf .webp - image/webp .appcache - text/cache-manifest .manifest - text/cache-manifest Also the following MIME types need updating: .ttf should be application/x-font-ttf and not application/octet-stream
1 parent 2981bb2 commit 545fa9e

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/Microsoft.AspNet.StaticFiles/FileExtensionContentTypeProvider.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace Microsoft.AspNet.StaticFiles
1212
/// </summary>
1313
public class FileExtensionContentTypeProvider : IContentTypeProvider
1414
{
15-
#region Extension mapping table
15+
#region Extension mapping table
1616
/// <summary>
1717
/// Creates a new provider with a set of default mappings.
1818
/// </summary>
@@ -38,6 +38,7 @@ public FileExtensionContentTypeProvider()
3838
{ ".aif", "audio/x-aiff" },
3939
{ ".aifc", "audio/aiff" },
4040
{ ".aiff", "audio/aiff" },
41+
{ ".appcache", "text/cache-manifest" },
4142
{ ".application", "application/x-ms-application" },
4243
{ ".art", "image/x-jg" },
4344
{ ".asd", "application/octet-stream" },
@@ -143,6 +144,7 @@ public FileExtensionContentTypeProvider()
143144
{ ".jpeg", "image/jpeg" },
144145
{ ".jpg", "image/jpeg" },
145146
{ ".js", "application/javascript" },
147+
{ ".json", "application/json" },
146148
{ ".jsx", "text/jscript" },
147149
{ ".latex", "application/x-latex" },
148150
{ ".lit", "application/x-ms-reader" },
@@ -310,7 +312,8 @@ public FileExtensionContentTypeProvider()
310312
{ ".trm", "application/x-msterminal" },
311313
{ ".ts", "video/vnd.dlna.mpeg-tts" },
312314
{ ".tsv", "text/tab-separated-values" },
313-
{ ".ttf", "application/octet-stream" },
315+
{ ".ttc", "application/x-font-ttf" },
316+
{ ".ttf", "application/x-font-ttf" },
314317
{ ".tts", "video/vnd.dlna.mpeg-tts" },
315318
{ ".txt", "text/plain" },
316319
{ ".u32", "application/octet-stream" },
@@ -334,6 +337,7 @@ public FileExtensionContentTypeProvider()
334337
{ ".wcm", "application/vnd.ms-works" },
335338
{ ".wdb", "application/vnd.ms-works" },
336339
{ ".webm", "video/webm" },
340+
{ ".webp", "image/webp" },
337341
{ ".wks", "application/vnd.ms-works" },
338342
{ ".wm", "video/x-ms-wm" },
339343
{ ".wma", "audio/x-ms-wma" },
@@ -393,7 +397,7 @@ public FileExtensionContentTypeProvider()
393397
})
394398
{
395399
}
396-
#endregion
400+
#endregion
397401

398402
/// <summary>
399403
/// Creates a lookup engine using the provided mapping.
@@ -431,4 +435,4 @@ public bool TryGetContentType(string subpath, out string contentType)
431435
return Mappings.TryGetValue(extension, out contentType);
432436
}
433437
}
434-
}
438+
}

0 commit comments

Comments
 (0)