Skip to content

Commit

Permalink
Merge pull request #2008 from bugsnag/lemnik/static-default-redacted-…
Browse files Browse the repository at this point in the history
…keys

Avoid compiling regexes in ObjectJsonStreamer
  • Loading branch information
lemnik authored Apr 10, 2024
2 parents 43e4cc8 + 081d194 commit 4679038
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)
[]()

* Allow `Bugsnag.startSession` to be called with automatic session tracking, and not have the first manual session be over written by the first automatic session.
[#2006](https://github.com/bugsnag/bugsnag-android/pull/2006)
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 4679038

Please sign in to comment.