We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ce818a1 commit 5489108Copy full SHA for 5489108
lib/sentry/client.ex
@@ -212,7 +212,7 @@ defmodule Sentry.Client do
212
213
with %URI{userinfo: userinfo, host: host, port: port, path: path, scheme: protocol}
214
when is_binary(path) and is_binary(userinfo) <- URI.parse(dsn),
215
- [public_key, secret_key | _] <- String.split(userinfo, ":", parts: 2) ++ [nil],
+ [public_key, secret_key] <- keys_from_userinfo(userinfo),
216
[_, binary_project_id] <- String.split(path, "/"),
217
{project_id, ""} <- Integer.parse(binary_project_id),
218
endpoint <- "#{protocol}://#{host}:#{port}/api/#{project_id}/store/" do
@@ -305,6 +305,14 @@ defmodule Sentry.Client do
305
end
306
307
308
+ defp keys_from_userinfo(userinfo) do
309
+ case String.split(userinfo, ":", parts: 2) do
310
+ [public, secret] -> [public, secret]
311
+ [public] -> [public, nil]
312
+ _ -> :error
313
+ end
314
315
+
316
defp get_headers_and_endpoint do
317
case get_dsn() do
318
{endpoint, public_key, secret_key} ->
0 commit comments