Commit 15dcff92 authored by Evgeny Khramtsov's avatar Evgeny Khramtsov

Use correct virtual host when consulting trusted_proxies

parent 9c2392f6
...@@ -530,7 +530,8 @@ analyze_ip_xff(IP, [], _Host) -> IP; ...@@ -530,7 +530,8 @@ analyze_ip_xff(IP, [], _Host) -> IP;
analyze_ip_xff({IPLast, Port}, XFF, Host) -> analyze_ip_xff({IPLast, Port}, XFF, Host) ->
[ClientIP | ProxiesIPs] = str:tokens(XFF, <<", ">>) ++ [ClientIP | ProxiesIPs] = str:tokens(XFF, <<", ">>) ++
[misc:ip_to_list(IPLast)], [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, IPClient = case is_ipchain_trusted(ProxiesIPs,
TrustedProxies) TrustedProxies)
of of
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment