25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-28 16:34:13 +01:00

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

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