Skip to content

Commit

Permalink
fix(json): make the default ObjectJsonStreamer.redactedKeys a static …
Browse files Browse the repository at this point in the history
…shared value (it's immutable)
  • Loading branch information
lemnik committed Apr 9, 2024
1 parent cabac65 commit 980e1eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

* FeatureFlags are now a copy-on-write structure, and so don't need to be defensive copied on a crashing thread
[#2005](https://github.com/bugsnag/bugsnag-android/pull/2005)
* The default redactedKeys in ObjectJsonStreamer is now static and shared, reducing the overhead of some leaveBreadcrumb calls (those with complex metadata)
[]()

## 6.3.0 (2024-03-19)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ internal class ObjectJsonStreamer {
companion object {
internal const val REDACTED_PLACEHOLDER = "[REDACTED]"
internal const val OBJECT_PLACEHOLDER = "[OBJECT]"

internal val DEFAULT_REDACTED_KEYS = setOf(Pattern.compile(".*password.*", Pattern.CASE_INSENSITIVE))
}

var redactedKeys = setOf(Pattern.compile(".*password.*", Pattern.CASE_INSENSITIVE))
var redactedKeys = DEFAULT_REDACTED_KEYS

// Write complex/nested values to a JsonStreamer
@Throws(IOException::class)
Expand Down

0 comments on commit 980e1eb

Please sign in to comment.