[ResponseCompression] Compare MimeTypes as case insensitive
This commit is contained in:
parent
665f2f8773
commit
89a6f453ce
|
|
@ -23,7 +23,7 @@ namespace Microsoft.AspNetCore.ResponseCompression
|
|||
throw new ArgumentNullException(nameof(mimeTypes));
|
||||
}
|
||||
|
||||
var mimeTypeSet = new HashSet<string>(mimeTypes);
|
||||
var mimeTypeSet = new HashSet<string>(mimeTypes, StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
return (httpContext) =>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ namespace Microsoft.AspNetCore.ResponseCompression.Tests
|
|||
|
||||
[Theory]
|
||||
[InlineData("text/plain")]
|
||||
[InlineData("text/PLAIN")]
|
||||
[InlineData("text/plain; charset=ISO-8859-4")]
|
||||
[InlineData("text/plain ; charset=ISO-8859-4")]
|
||||
public void CreateShouldCompressResponseDelegate_WithCharset_Compress(string contentType)
|
||||
|
|
@ -53,7 +54,6 @@ namespace Microsoft.AspNetCore.ResponseCompression.Tests
|
|||
[Theory]
|
||||
[InlineData("")]
|
||||
[InlineData("text/plain2")]
|
||||
[InlineData("text/PLAIN")]
|
||||
public void CreateShouldCompressResponseDelegate_OtherContentTypes_NoMatch(string contentType)
|
||||
{
|
||||
var httpContext = new DefaultHttpContext();
|
||||
|
|
|
|||
Loading…
Reference in New Issue