From: Remi Gacogne Date: Mon, 17 Jun 2024 12:36:48 +0000 (+0200) Subject: dnsdist: Fix replacement of existing custom web handlers X-Git-Tag: rec-5.2.0-alpha0~15^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9723e98316bbdfcdede43d8d8ccbaf82bb283268;p=thirdparty%2Fpdns.git dnsdist: Fix replacement of existing custom web handlers --- diff --git a/pdns/dnsdistdist/dnsdist-web.cc b/pdns/dnsdistdist/dnsdist-web.cc index 4e18a63752..f439fe9b4a 100644 --- a/pdns/dnsdistdist/dnsdist-web.cc +++ b/pdns/dnsdistdist/dnsdist-web.cc @@ -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()