File tree Expand file tree Collapse file tree 2 files changed +9
-18
lines changed Expand file tree Collapse file tree 2 files changed +9
-18
lines changed Original file line number Diff line number Diff line change @@ -36,13 +36,14 @@ defmodule Sentry.Phoenix.Endpoint do
3636 request = Sentry.Plug . build_request_interface_data ( conn , [ ] )
3737 exception = Exception . normalize ( kind , reason , stacktrace )
3838
39- Sentry . capture_exception (
40- exception ,
41- stacktrace: stacktrace ,
42- request: request ,
43- event_source: :endpoint ,
44- error_type: kind
45- )
39+ _ =
40+ Sentry . capture_exception (
41+ exception ,
42+ stacktrace: stacktrace ,
43+ request: request ,
44+ event_source: :endpoint ,
45+ error_type: kind
46+ )
4647
4748 :erlang . raise ( kind , reason , stacktrace )
4849 end
Original file line number Diff line number Diff line change @@ -171,24 +171,14 @@ if Code.ensure_loaded?(Plug) do
171171 headers: handle_data ( conn , header_scrubber ) ,
172172 env: % {
173173 "REMOTE_ADDR" => remote_address ( conn . remote_ip ) ,
174- "REMOTE_PORT" => remote_port ( conn ) ,
174+ "REMOTE_PORT" => Plug.Conn . get_peer_data ( conn ) . port ,
175175 "SERVER_NAME" => conn . host ,
176176 "SERVER_PORT" => conn . port ,
177177 "REQUEST_ID" => Plug.Conn . get_resp_header ( conn , request_id ) |> List . first ( )
178178 }
179179 }
180180 end
181181
182- defp remote_port ( conn ) do
183- case Plug.Conn . get_peer_data ( conn ) do
184- % { port: port } ->
185- port
186-
187- _ ->
188- ""
189- end
190- end
191-
192182 defp remote_address ( address ) do
193183 address
194184 |> :inet . ntoa ( )
You can’t perform that action at this time.
0 commit comments