aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-02-18 12:00:00 +0100
committerKim Alvefur <zash@zash.se>2021-02-18 12:00:00 +0100
commit80116bf0e3cd26cd843b0b18ee09e09469ffa8e3 (patch)
treefec456d02e6428581c35fd25e6ba0bdb1b9ec8d8 /plugins
parent269069faa6cedc51a52e7b6d29d7dc8e9d60b6e7 (diff)
downloadprosody-80116bf0e3cd26cd843b0b18ee09e09469ffa8e3.tar.gz
prosody-80116bf0e3cd26cd843b0b18ee09e09469ffa8e3.zip
mod_http: Skip IP resolution in non-proxied case
Skips doing the whole get_ip_from_request() dance if the request isn't from a proxy at all, even if the client sent the header for some reason.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_http.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/mod_http.lua b/plugins/mod_http.lua
index a1d409bd..0a365274 100644
--- a/plugins/mod_http.lua
+++ b/plugins/mod_http.lua
@@ -174,7 +174,7 @@ end
module:wrap_object_event(server._events, false, function (handlers, event_name, event_data)
local request = event_data.request;
- if request then
+ if request and is_trusted_proxy(request.conn:ip()) then
-- Not included in eg http-error events
request.ip = get_ip_from_request(request);
end