Skip to content

Commit

Permalink
Fix failing sanitize tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gregkalapos committed May 25, 2021
1 parent 26c4b0c commit 13f672a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Elastic.Apm/Filters/ErrorContextSanitizerFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public IError Filter(IError error)
{
if (realError.Context.Request?.Headers != null && realError.ConfigSnapshot != null)
{
foreach (var key in realError.Context?.Request?.Headers?.Keys)
foreach (var key in realError.Context?.Request?.Headers?.Keys.ToList())
{
if (WildcardMatcher.IsAnyMatch(realError.ConfigSnapshot.SanitizeFieldNames, key))
realError.Context.Request.Headers[key] = Consts.Redacted;
Expand Down
2 changes: 1 addition & 1 deletion src/Elastic.Apm/Filters/HeaderDictionarySanitizerFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public ITransaction Filter(ITransaction transaction)
{
if (realTransaction.IsContextCreated && realTransaction.Context.Request?.Headers != null)
{
foreach (var key in realTransaction.Context?.Request?.Headers?.Keys)
foreach (var key in realTransaction.Context?.Request?.Headers?.Keys.ToList())
{
if (WildcardMatcher.IsAnyMatch(realTransaction.ConfigSnapshot.SanitizeFieldNames, key))
realTransaction.Context.Request.Headers[key] = Consts.Redacted;
Expand Down

0 comments on commit 13f672a

Please sign in to comment.