@fsfs wrote:
this is work in 1.9.x
acl api_check path_beg -i “/check”
#http-request lua.check_quth if api_check#lua
---------check_req
core.register_action(“api_check_req”, { “http-req” }, function(applet)
local msg = ‘{“status”:1,“message”:“Could not authenticate you.”}’
applet.res:send(‘HTTP/1.0 200 OK\r\nContent-Type: application/json\r\nConnection: close\r\n\r\n’…msg)
applet:done()
end)#error
[ALERT] 323/163943 (1236) : Lua function ‘api_check_req’: runtime error: 0 from [C] method ‘set’, /root/hap/api.lua:762 C function line 756.
Posts: 1
Participants: 1