Lua API: Add path field

Signed-off-by: Jianhui Zhao <jianhuizhao329@gmail.com>
This commit is contained in:
Jianhui Zhao committed 2018-07-18 14:13:12 +08:00
1 parent 365e84fec3
commit 87c00d2291
2 files changed
+4

No files matched your search

Regular → Executable
+1
View File
@@ -41,6 +41,7 @@ srv:add_action("/lua", function(cl, opt)
uh.chunk_send(cl, string.format("<h1>REMOTE_ADDR: %s</h1>", opt.peer_addr))
uh.chunk_send(cl, string.format("<h1>METHOD: %s</h1>", opt.method))
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>URL: %s</h1>", opt.url))
uh.chunk_send(cl, string.format("<h1>QUERY: %s</h1>", opt.query))
uh.chunk_send(cl, string.format("<h1>Body: %s</h1>", opt.body and opt.body or ""))
+3
View File
@@ -101,6 +101,9 @@ static void lua_uh_action(struct uh_client *cl)
lua_pushstring(L, cl->get_version(cl));
lua_setfield(L, -2, "version");
lua_pushstring(L, cl->get_path(cl));
lua_setfield(L, -2, "path");
lua_pushstring(L, cl->get_url(cl));
lua_setfield(L, -2, "url");