Skip to content

Commit 580490e

Browse files
rdeagogeoperez
authored andcommitted
Make DefaultMimeTypes read-write again (fixes #302). (#303)
1 parent 8411e08 commit 580490e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/Unosquare.Labs.EmbedIO/Constants/MimeTypes.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
namespace Unosquare.Labs.EmbedIO.Constants
22
{
3+
using System.Collections.Concurrent;
34
using System.Collections.Generic;
45

56
/// <summary>
@@ -15,7 +16,7 @@ public static class MimeTypes
1516
/// on 2019-04-26.
1617
/// Licensed under MIT license as per https://github.com/samuelneff/MimeTypeMap/blob/master/LICENSE
1718
/// </remarks>
18-
public static IReadOnlyDictionary<string, string> DefaultMimeTypes { get; } = new Dictionary<string, string>(Strings.StandardStringComparer)
19+
public static IDictionary<string, string> DefaultMimeTypes { get; } = new ConcurrentDictionary<string, string>(new Dictionary<string, string>(Strings.StandardStringComparer)
1920
{
2021
#region Big freaking list of mime types
2122

@@ -699,6 +700,6 @@ public static class MimeTypes
699700
{"x-world/x-vrml", ".xof"},
700701

701702
#endregion
702-
};
703+
}, Strings.StandardStringComparer);
703704
}
704705
}

src/Unosquare.Labs.EmbedIO/Modules/FileModuleBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public abstract class FileModuleBase
2525
/// <value>
2626
/// The MIME type dictionary.
2727
/// </value>
28-
public IReadOnlyDictionary<string, string> MimeTypes { get; } = Constants.MimeTypes.DefaultMimeTypes;
28+
public IDictionary<string, string> MimeTypes { get; } = Constants.MimeTypes.DefaultMimeTypes;
2929

3030
/// <summary>
3131
/// The default headers.

0 commit comments

Comments
 (0)