File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 1+ ## Unreleased
2+
3+ - Tweak credit card regex handling for OTP-28 ([ #898 ] ( https://github.com/getsentry/sentry-elixir/pull/898 ) )
4+
15# Changelog
26
37## 10.10.0
Original file line number Diff line number Diff line change @@ -155,7 +155,6 @@ defmodule Sentry.PlugContext do
155155
156156 @ default_scrubbed_param_keys [ "password" , "passwd" , "secret" ]
157157 @ default_scrubbed_header_keys [ "authorization" , "authentication" , "cookie" ]
158- @ credit_card_regex ~r/ ^(?:\d [ -]*?){13,16}$/
159158 @ scrubbed_value "*********"
160159 @ default_plug_request_id_header "x-request-id"
161160
@@ -277,7 +276,7 @@ defmodule Sentry.PlugContext do
277276 value =
278277 cond do
279278 key in scrubbed_keys -> @ scrubbed_value
280- is_binary ( value ) and value =~ @ credit_card_regex -> @ scrubbed_value
279+ is_binary ( value ) and value =~ credit_card_regex ( ) -> @ scrubbed_value
281280 is_struct ( value ) -> value |> Map . from_struct ( ) |> scrub_map ( scrubbed_keys )
282281 is_map ( value ) -> scrub_map ( value , scrubbed_keys )
283282 is_list ( value ) -> scrub_list ( value , scrubbed_keys )
@@ -298,4 +297,6 @@ defmodule Sentry.PlugContext do
298297 end
299298 end )
300299 end
300+
301+ defp credit_card_regex , do: ~r/ ^(?:\d [ -]*?){13,16}$/
301302end
You can’t perform that action at this time.
0 commit comments