]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Fix replacement of existing custom web handlers
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 17 Jun 2024 12:36:48 +0000 (14:36 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 17 Jun 2024 12:36:48 +0000 (14:36 +0200)
pdns/dnsdistdist/dnsdist-web.cc

index 4e18a637529b9ed79b7a5c5f5881d0494fc36ba7..f439fe9b4a6de5759a8794fdd2078f51f7ec8684 100644 (file)
@@ -1730,7 +1730,7 @@ void registerWebHandler(const std::string& endpoint, WebHandler handler, bool is
 void registerWebHandler(const std::string& endpoint, WebHandler handler, bool isLua)
 {
   auto handlers = s_webHandlers.write_lock();
-  (*handlers).emplace(std::make_pair(endpoint, WebHandlerContext{std::move(handler), isLua}));
+  (*handlers)[endpoint] = WebHandlerContext{std::move(handler), isLua};
 }
 
 void clearWebHandlers()