summaryrefslogtreecommitdiffstats
path: root/dnsdist-lua-web.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-26 06:28:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-26 06:28:35 +0000
commit94747970b5724254236b51cd41b77893785c7af6 (patch)
tree593ed52e2978ddf5ffe91ed81111e73d57807d30 /dnsdist-lua-web.cc
parentAdding debian version 1.9.4-1. (diff)
downloaddnsdist-94747970b5724254236b51cd41b77893785c7af6.tar.xz
dnsdist-94747970b5724254236b51cd41b77893785c7af6.zip
Merging upstream version 1.9.5.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dnsdist-lua-web.cc')
-rw-r--r--dnsdist-lua-web.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/dnsdist-lua-web.cc b/dnsdist-lua-web.cc
index 0498aed..35cf0d0 100644
--- a/dnsdist-lua-web.cc
+++ b/dnsdist-lua-web.cc
@@ -25,14 +25,14 @@
#include "dnsdist-lua.hh"
#include "dnsdist-web.hh"
-void registerWebHandler(const std::string& endpoint, std::function<void(const YaHTTP::Request&, YaHTTP::Response&)> handler);
+void registerWebHandler(const std::string& endpoint, std::function<void(const YaHTTP::Request&, YaHTTP::Response&)> handler, bool isLua);
void setupLuaWeb(LuaContext& luaCtx)
{
#ifndef DISABLE_LUA_WEB_HANDLERS
luaCtx.writeFunction("registerWebHandler", [](const std::string& path, std::function<void(const YaHTTP::Request*, YaHTTP::Response*)> handler) {
/* LuaWrapper does a copy for objects passed by reference, so we pass a pointer */
- registerWebHandler(path, [handler](const YaHTTP::Request& req, YaHTTP::Response& resp) { handler(&req, &resp); });
+ registerWebHandler(path, [handler](const YaHTTP::Request& req, YaHTTP::Response& resp) { handler(&req, &resp); }, true);
});
luaCtx.registerMember<std::string(YaHTTP::Request::*)>("path", [](const YaHTTP::Request& req) -> std::string { return req.url.path; }, [](YaHTTP::Request& req, const std::string& path) { (void) path; });
@@ -78,4 +78,3 @@ void setupLuaWeb(LuaContext& luaCtx)
});
#endif /* DISABLE_LUA_WEB_HANDLERS */
}
-