From 15dcff92e8450f5bb70b6627ab08bca09374b2c0 Mon Sep 17 00:00:00 2001 From: Evgeny Khramtsov Date: Sat, 13 Jul 2019 12:20:06 +0300 Subject: [PATCH] Use correct virtual host when consulting trusted_proxies --- src/ejabberd_http.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ejabberd_http.erl b/src/ejabberd_http.erl index 6f90cfcd7..368a5227e 100644 --- a/src/ejabberd_http.erl +++ b/src/ejabberd_http.erl @@ -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 -- 2.40.0