Description
Specifically the following situation will make the server fail to restart
– /tmp/global_lua.lua , used in plugin.config
ts.add_package_path('/tmp/lib/?.lua')
local g_config = require "g_config"
function send_response()
ts.client_response.header['g_Rhost'] = ts.ctx['rhost']
ts.client_response.header['g_config'] = g_config.name
return 0
end
function do_global_read_request()
local req_host = ts.client_request.header.Host
ts.ctx['rhost'] = string.reverse(req_host)
ts.hook(TS_LUA_HOOK_SEND_RESPONSE_HDR, send_response)
return 0
end
– /tmp/lib/g_config.lua
local g_config = {}
g_config.name = 'xxx'
return g_config
– /tmp/remap_lua.lua , used in remap.config
ts.add_package_path('/tmp/lib/?.lua')
local r_config = require "r_config"
function send_response()
ts.client_response.header['r_Rhost'] = ts.ctx['rhost']
ts.client_response.header['r_config'] = r_config.name
return 0
end
function do_remap()
local req_host = ts.client_request.header.Host
ts.ctx['rhost'] = string.reverse(req_host)
ts.hook(TS_LUA_HOOK_SEND_RESPONSE_HDR, send_response)
return 0
end
– /tmp/lib/r_config.lua
local r_config = {}
r_config.name = 'yyy'
return r_config
That's because of a bug in the code for adding package path. Providing a fix soon.