From 4635a388fd6ff78cc54b65fef6339783b362cee7 Mon Sep 17 00:00:00 2001 From: Richard Walkden Date: Mon, 24 Aug 2026 14:00:46 +0100 Subject: [PATCH 1/2] log raw host header --- src/lua_resty_netacea_ingest.lua | 2 +- test/lua_resty_netacea_ingest_spec.lua | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/lua_resty_netacea_ingest.lua b/src/lua_resty_netacea_ingest.lua index c6fb30a..9cb6352 100644 --- a/src/lua_resty_netacea_ingest.lua +++ b/src/lua_resty_netacea_ingest.lua @@ -241,7 +241,7 @@ function Ingest:ingest() IntegrationType = self._N._MODULE_TYPE, IntegrationVersion = self._N._MODULE_VERSION, Query = vars.query_string or "", - RequestHost = vars.host or "", + RequestHost = vars.http_host or vars.host or "", RequestId = vars.request_id or "", ProtectionMode = self._N.mitigationType or "ERROR", -- TODO diff --git a/test/lua_resty_netacea_ingest_spec.lua b/test/lua_resty_netacea_ingest_spec.lua index 0a64cf6..2ed1aed 100644 --- a/test/lua_resty_netacea_ingest_spec.lua +++ b/test/lua_resty_netacea_ingest_spec.lua @@ -411,6 +411,15 @@ describe("lua_resty_netacea_ingest", function() assert.is.equal("monitor", queued_item.ProtectionMode) end) + it("should use the raw http_host header, including port, when present", function() + ngx_mock.var.http_host = "test.example.com:8443" + + ingest:ingest() + + local queued_item = ingest.data_queue:pop() + assert.is.equal("test.example.com:8443", queued_item.RequestHost) + end) + it("should handle missing ngx.ctx.mitata by falling back to cookie", function() ngx_mock.ctx.mitata = nil From b3be6a8debb1869e3021cb3fc986dd5e2d9dc79a Mon Sep 17 00:00:00 2001 From: Richard Walkden Date: Tue, 25 Aug 2026 09:35:25 +0100 Subject: [PATCH 2/2] version bump to 1.6.4 --- ...tacea-1.6.3-0.rockspec => lua_resty_netacea-1.6.4-0.rockspec | 2 +- src/lua_resty_netacea.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename lua_resty_netacea-1.6.3-0.rockspec => lua_resty_netacea-1.6.4-0.rockspec (98%) diff --git a/lua_resty_netacea-1.6.3-0.rockspec b/lua_resty_netacea-1.6.4-0.rockspec similarity index 98% rename from lua_resty_netacea-1.6.3-0.rockspec rename to lua_resty_netacea-1.6.4-0.rockspec index f17a35c..f194170 100644 --- a/lua_resty_netacea-1.6.3-0.rockspec +++ b/lua_resty_netacea-1.6.4-0.rockspec @@ -1,5 +1,5 @@ package = "lua_resty_netacea" -version = "1.6.3-0" +version = "1.6.4-0" source = { url = "git://github.com/Netacea/lua_resty_netacea", branch = "master" diff --git a/src/lua_resty_netacea.lua b/src/lua_resty_netacea.lua index c80e0ce..39d0f43 100644 --- a/src/lua_resty_netacea.lua +++ b/src/lua_resty_netacea.lua @@ -8,7 +8,7 @@ local Constants = require("lua_resty_netacea_constants") local mitigation = require("lua_resty_netacea_mitigation") local _N = {} -_N._VERSION = '1.6.3' +_N._VERSION = '1.6.4' _N._TYPE = 'nginx' local ngx = require 'ngx'