# HG changeset patch # User Kim Alvefur # Date 1613646000 -3600 # Node ID 8603011e51fea361f50c179f5a9ecca4d6ea50d9 # Parent ab334ddc61528ad0a2d30d9eedf79b79c7e64030 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. diff -r ab334ddc6152 -r 8603011e51fe plugins/mod_http.lua --- a/plugins/mod_http.lua Mon Feb 15 18:16:07 2021 +0100 +++ b/plugins/mod_http.lua Thu Feb 18 12:00:00 2021 +0100 @@ -174,7 +174,7 @@ 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