Skip to content

Commit e030350

Browse files
authored
Merge pull request #449 from newrelic/bandit-handle-no-conn
Handle when Bandit was unable to create a conn
2 parents d4a8db6 + 922ed7f commit e030350

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/new_relic/telemetry/plug.ex

+6-2
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,12 @@ defmodule NewRelic.Telemetry.Plug do
268268
end
269269
end
270270

271-
defp get_headers(meta, :bandit) do
272-
Map.new(meta.conn.req_headers)
271+
defp get_headers(%{conn: conn}, :bandit) do
272+
Map.new(conn.req_headers)
273+
end
274+
275+
defp get_headers(_, :bandit) do
276+
%{}
273277
end
274278

275279
defp get_headers(meta, :cowboy) do

0 commit comments

Comments
 (0)