错误日志发现如下问题:[error] 5772#0: *99870 attempt to set status 400 via ngx.exit after sending out the response status 200
local say = function(content, status)
pcall(function() ngx.say(content) end)
if status then
ngx.exit(status)
end
end
say(cjson.encode(failure), ngx.HTTP_BAD_REQUEST)
其中,之所以用pcall是为了防止客户端主动断开后ngx.say报错,其他地方没有输出HTTP_OK响应头,请问原因?