Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit 96f57b9

Browse files
committed
build: production
1 parent 54668fe commit 96f57b9

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed
44 Bytes
Binary file not shown.

lib/helper/parse_remote_ip.ex

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,20 @@ defmodule Helper.RemoteIP do
66
# remote ip is the fisrt ip in the proxy_ips chain
77
def parse([proxy_ips, _]) do
88
client_ip = proxy_ips |> String.split(",") |> List.first()
9+
case client_ip not in slb_ips do
10+
true ->
11+
{:ok, client_ip}
912

10-
{:ok, client_ip}
13+
false ->
14+
{:error, "skip"}
15+
end
1116
end
1217

1318
def parse(_) do
1419
{:error, "NOT_FOUND"}
1520
end
21+
22+
defp slb_ips do
23+
["47.100.162.182"]
24+
end
1625
end

0 commit comments

Comments
 (0)