Skip to content

Commit dc54912

Browse files
Merge pull request #181 from bugsnag/PLAT-13952/case-insensitive-metadata-filters
Make MetadataFilters case insensitive
2 parents a8f69d3 + 13f665d commit dc54912

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/Bugsnag/Serializer.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System;
12
using System.Collections.Generic;
23
using System.Diagnostics;
34
using System.Linq;
@@ -15,7 +16,7 @@ public static string SerializeObject(object obj)
1516
public static string SerializeObject(object obj, string[] filters)
1617
{
1718
var parsedFilters = filters != null ?
18-
filters.ToDictionary(m => m, m => true) :
19+
filters.ToDictionary(m => m, m => true, StringComparer.OrdinalIgnoreCase) :
1920
new Dictionary<string, bool>();
2021

2122
try

tests/Bugsnag.Tests/SerializerTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ public static IEnumerable<object[]> FilterTestData()
8787
yield return new object[] { new FilterableTestObject { { "password", "password" } }, null, 0 };
8888
yield return new object[] { new FilterableTestObject { { "username", "password" } }, new string[] { "password" }, 0 };
8989
yield return new object[] { new FilterableTestObject { { "password", "password" }, { "credit_card_number", "number" } }, new string[] { "password", "credit_card_number" }, 2 };
90+
yield return new object[] { new FilterableTestObject { { "Password", "password" }, { "Credit_Card_Number", "number" } }, new string[] { "password", "credit_card_number" }, 2 };
9091
}
9192
}
9293
}

0 commit comments

Comments
 (0)