Comparison

plugins/mod_http.lua @ 11382:a0477656258c

Merge 0.11->trunk
author Kim Alvefur <zash@zash.se>
date Thu, 18 Feb 2021 12:02:11 +0100
parent 11066:dc41c8dfd2b1
parent 11381:8603011e51fe
child 11383:98b7ae7064b2
comparison
equal deleted inserted replaced
11380:9a1758c5aaa4 11382:a0477656258c
254 return ip; 254 return ip;
255 end 255 end
256 256
257 module:wrap_object_event(server._events, false, function (handlers, event_name, event_data) 257 module:wrap_object_event(server._events, false, function (handlers, event_name, event_data)
258 local request = event_data.request; 258 local request = event_data.request;
259 if request then 259 if request and is_trusted_proxy(request.conn:ip()) then
260 -- Not included in eg http-error events 260 -- Not included in eg http-error events
261 request.ip = get_ip_from_request(request); 261 request.ip = get_ip_from_request(request);
262 end 262 end
263 return handlers(event_name, event_data); 263 return handlers(event_name, event_data);
264 end); 264 end);