From 78766026c269f2df7575895849caf4365fad7211 Mon Sep 17 00:00:00 2001 From: Allan Que Date: Wed, 8 Jul 2026 19:08:01 -0500 Subject: [PATCH] Add IPv6 address support --- auth-request.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/auth-request.lua b/auth-request.lua index 1504948..0bfd859 100644 --- a/auth-request.lua +++ b/auth-request.lua @@ -145,6 +145,11 @@ function auth_request(txn, be, path, method, hdr_req, hdr_succeed, hdr_fail) return end + -- Enclose IPv6 addresses in square brackets + if not addr:find("%.") and not addr:match("^%[.*%]:%d+$") then + addr = string.format("[%s]:%s", addr:match("^(.*):(%d+)$")) + end + -- Transform table of request headers from haproxy's to -- socket.http's format. local headers = {}