Skip to content

Commit f38d756

Browse files
committed
add test
1 parent f95cfc7 commit f38d756

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/plug_test.exs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,22 @@ defmodule Sentry.PlugTest do
113113
"passwd" => "*********", "credit_card" => "*********", "cc" => "*********",
114114
"another_cc" => "*********"}
115115
end
116+
117+
test "default data scrubbing of binary" do
118+
conn = conn(:post, "/error_route", %{
119+
"secret" => "world",
120+
"password" => "test",
121+
"passwd" => "4242424242424242",
122+
"credit_card" => "4197 7215 7810 8280",
123+
"count" => 334,
124+
"is_admin" => false,
125+
"cc" => "4197-7215-7810-8280",
126+
"another_cc" => "4197721578108280"})
127+
128+
request_data = Sentry.Plug.build_request_interface_data(conn, body_scrubber: &Sentry.Plug.default_body_scrubber/1)
129+
assert request_data[:method] == "POST"
130+
assert request_data[:data] == %{"secret" => "*********", "password" => "*********", "count" => 334,
131+
"is_admin" => false, "passwd" => "*********", "credit_card" => "*********", "cc" => "*********",
132+
"another_cc" => "*********"}
133+
end
116134
end

0 commit comments

Comments
 (0)