Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/lua_resty_netacea.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion src/lua_resty_netacea_ingest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions test/lua_resty_netacea_ingest_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down