Use correct virtual host when consulting trusted_proxies

This commit is contained in:
Evgeny Khramtsov 2019-07-13 12:20:06 +03:00
parent 9c2392f6e9
commit 15dcff92e8
1 changed files with 2 additions and 1 deletions

View File

@ -530,7 +530,8 @@ analyze_ip_xff(IP, [], _Host) -> IP;
analyze_ip_xff({IPLast, Port}, XFF, Host) ->
[ClientIP | ProxiesIPs] = str:tokens(XFF, <<", ">>) ++
[misc:ip_to_list(IPLast)],
TrustedProxies = ejabberd_option:trusted_proxies(Host),
ServerHost = ejabberd_router:host_of_route(Host),
TrustedProxies = ejabberd_option:trusted_proxies(ServerHost),
IPClient = case is_ipchain_trusted(ProxiesIPs,
TrustedProxies)
of