Skip to content

Commit 9cdfaac

Browse files
Merge pull request #211 from covermymeds/ignore-non-string-dsn
Add check_dsn: false to source_code_path_pattern
2 parents 36a0905 + 1744fbb commit 9cdfaac

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

lib/sentry/config.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ defmodule Sentry.Config do
7070
end
7171

7272
def source_code_path_pattern do
73-
get_config(:source_code_path_pattern, default: @default_path_pattern)
73+
get_config(:source_code_path_pattern, default: @default_path_pattern, check_dsn: false)
7474
end
7575

7676
def source_code_exclude_patterns do

test/config_test.exs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,21 @@ defmodule Sentry.ConfigTest do
2020

2121
assert "my_server" == Config.server_name()
2222
end
23+
24+
describe "source_code_path_pattern" do
25+
test "retrieves from environment" do
26+
modify_env(:sentry, source_code_path_pattern: "**/*test.ex")
27+
assert "**/*test.ex" == Config.source_code_path_pattern()
28+
end
29+
30+
test "returns default when not configured" do
31+
assert "**/*.ex" == Config.source_code_path_pattern()
32+
end
33+
34+
test "does not retrieve from DSN" do
35+
dsn = "https://public:[email protected]/2?source_code_path_pattern=test"
36+
modify_env(:sentry, dsn: dsn)
37+
refute "test" == Config.source_code_path_pattern()
38+
end
39+
end
2340
end

0 commit comments

Comments
 (0)