We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7488cb2 commit 5fd33b1Copy full SHA for 5fd33b1
platform/lib/platform_web/plugs/remote_ip.ex
@@ -9,7 +9,14 @@ defmodule PlatformWeb.Plugs.RemoteIp do
9
remote_ip =
10
case get_req_header(conn, "fly-client-ip") do
11
[val] -> val
12
- _ -> to_string(:inet_parse.ntoa(conn.remote_ip))
+ _ -> case conn.remote_ip do
13
+ x when is_binary(x) ->
14
+ # If it's already a string, use it directly
15
+ x
16
+ x when is_tuple(x) ->
17
+ # Convert tuple to string representation
18
+ :inet.ntoa(x) |> to_string()
19
+ end
20
end
21
22
Logger.metadata(remote_ip: remote_ip)
0 commit comments