From 89b7d46e68195a75e2e044ac3bb2610d65c35ea0 Mon Sep 17 00:00:00 2001 From: selboo Date: Fri, 29 Nov 2019 13:43:06 +0800 Subject: [PATCH] fix: TXT max 255 --- lib/resty/dns/server.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/resty/dns/server.lua b/lib/resty/dns/server.lua index 458e814..d9fc140 100644 --- a/lib/resty/dns/server.lua +++ b/lib/resty/dns/server.lua @@ -565,6 +565,10 @@ function _M.create_txt_answer(self, name, ttl, txt) return "txt nil" end + if #txt >= 255 then + txt = strsub(txt,1,255) + end + local answer = {} answer.name = name answer.type = TYPE_TXT