From 2acba6238860aaf3e323b12ddcd6d89d6644b486 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 27 Feb 2021 21:37:16 +0100 Subject: net.http.server: Set request.ip so mod_http doesn't have to Because it already sets request.secure, which depends on the connection, just like the IP, so it makes sense to do both in the same place. Dealing with proxies can be left to mod_http for now, but maybe it could move into some util some day? --- plugins/mod_http.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/mod_http.lua b/plugins/mod_http.lua index b9a76c90..d81f4ab7 100644 --- a/plugins/mod_http.lua +++ b/plugins/mod_http.lua @@ -260,7 +260,7 @@ local function is_trusted_proxy(ip) end local function get_ip_from_request(request) - local ip = request.conn:ip(); + local ip = request.ip; local forwarded_for = request.headers.x_forwarded_for; if forwarded_for and is_trusted_proxy(ip) then -- luacheck: ignore 631 -- cgit v1.2.3