Software /
code /
prosody
Comparison
plugins/mod_http.lua @ 11386:e40ba204c612 0.11
mod_http: Fix trusted proxies check (thanks buildbot)
is_trusted_proxy() is only in trunk, I dun goofed when I rebased
8603011e51fe from trunk.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 18 Feb 2021 14:34:38 +0100 |
parent | 11381:8603011e51fe |
child | 11387:4f97b33e2596 |
child | 11407:8d6e013377fa |
comparison
equal
deleted
inserted
replaced
11381:8603011e51fe | 11386:e40ba204c612 |
---|---|
172 return ip; | 172 return ip; |
173 end | 173 end |
174 | 174 |
175 module:wrap_object_event(server._events, false, function (handlers, event_name, event_data) | 175 module:wrap_object_event(server._events, false, function (handlers, event_name, event_data) |
176 local request = event_data.request; | 176 local request = event_data.request; |
177 if request and is_trusted_proxy(request.conn:ip()) then | 177 if request and trusted_proxies[request.conn:ip()] then |
178 -- Not included in eg http-error events | 178 -- Not included in eg http-error events |
179 request.ip = get_ip_from_request(request); | 179 request.ip = get_ip_from_request(request); |
180 end | 180 end |
181 return handlers(event_name, event_data); | 181 return handlers(event_name, event_data); |
182 end); | 182 end); |