Lua API: example: Check whether the query is nil

Signed-off-by: Jianhui Zhao <jianhuizhao329@gmail.com>
main
Jianhui Zhao 2018-07-18 14:15:48 +08:00
parent 87c00d2291
commit 64d3036347
1 changed files with 1 additions and 1 deletions

View File

@ -43,7 +43,7 @@ srv:add_action("/lua", function(cl, opt)
uh.chunk_send(cl, string.format("<h1>HTTP Version: %s</h1>", opt.version)) uh.chunk_send(cl, string.format("<h1>HTTP Version: %s</h1>", opt.version))
uh.chunk_send(cl, string.format("<h1>PATH: %s</h1>", opt.path)) uh.chunk_send(cl, string.format("<h1>PATH: %s</h1>", opt.path))
uh.chunk_send(cl, string.format("<h1>URL: %s</h1>", opt.url)) uh.chunk_send(cl, string.format("<h1>URL: %s</h1>", opt.url))
uh.chunk_send(cl, string.format("<h1>QUERY: %s</h1>", opt.query)) uh.chunk_send(cl, string.format("<h1>QUERY: %s</h1>", opt.query and opt.query or ""))
uh.chunk_send(cl, string.format("<h1>Body: %s</h1>", opt.body and opt.body or "")) uh.chunk_send(cl, string.format("<h1>Body: %s</h1>", opt.body and opt.body or ""))
for k, v in pairs(opt.vars) do for k, v in pairs(opt.vars) do