]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Tidy
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Thu, 4 Sep 2025 12:33:37 +0000 (14:33 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 12 Nov 2025 08:09:27 +0000 (09:09 +0100)
Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
pdns/webserver.cc

index e292742ace290ccc457b2e3dc4c975638bc979e2..593ecf56662b2a84681945f05abb86ed0a8d4654 100644 (file)
@@ -206,8 +206,8 @@ void WebServer::apiWrapper(const WebServer::HandlerFunction& handler, HttpReques
 }
 
 void WebServer::registerApiHandler(const string& url, const HandlerFunction& handler, const std::string& method, bool allowPassword) {
-  auto f = [=,this](HttpRequest *req, HttpResponse* resp){apiWrapper(handler, req, resp, allowPassword);};
-  registerBareHandler(url, f, method);
+  auto func = [handler, allowPassword, this](HttpRequest *req, HttpResponse* resp){apiWrapper(handler, req, resp, allowPassword);};
+  registerBareHandler(url, func, method);
 }
 
 void WebServer::webWrapper(const WebServer::HandlerFunction& handler, HttpRequest* req, HttpResponse* resp) {
@@ -224,8 +224,8 @@ void WebServer::webWrapper(const WebServer::HandlerFunction& handler, HttpReques
 }
 
 void WebServer::registerWebHandler(const string& url, const HandlerFunction& handler, const std::string& method) {
-  auto f = [=,this](HttpRequest *req, HttpResponse *resp){webWrapper(handler, req, resp);};
-  registerBareHandler(url, f, method);
+  auto func = [handler, this](HttpRequest *req, HttpResponse *resp){webWrapper(handler, req, resp);};
+  registerBareHandler(url, func, method);
 }
 
 static void* WebServerConnectionThreadStart(const WebServer* webServer, const std::shared_ptr<Socket>& client)