From b9b01d7fd8510a66dd3cc0e618cd7e7e0db5da50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E7=94=B7?= Date: Sun, 4 Sep 2022 00:52:00 +0800 Subject: [PATCH] return HtyResponse format for upt --- scripts/upt.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/upt.lua b/scripts/upt.lua index ef559b3..25d4d6c 100644 --- a/scripts/upt.lua +++ b/scripts/upt.lua @@ -3,6 +3,10 @@ package.path = package.path .. ';/?.lua'; --todo: add verify local Upt = require("lib.upt") +local cjson = require "cjson" + local uri = ngx.unescape_uri(ngx.var.arg_uri) ngx.log(ngx.INFO, 'URI -> ' .. uri) -ngx.say(Upt.upt(uri)) \ No newline at end of file + +ngx.say(cjson.encode({r = true, d = Upt.upt(uri), e = nil})) +