From: Aki Tuomi Date: Wed, 23 Aug 2023 13:05:26 +0000 (+0300) Subject: ws-recursor.cc: Remove redundant checks for method X-Git-Tag: auth-4.9.0-alpha1~42^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0ac79b601cc24eab89c50e85d572a04dc1ec9a94;p=thirdparty%2Fpdns.git ws-recursor.cc: Remove redundant checks for method --- diff --git a/pdns/recursordist/ws-recursor.cc b/pdns/recursordist/ws-recursor.cc index b1880b6754..a1ada80c7a 100644 --- a/pdns/recursordist/ws-recursor.cc +++ b/pdns/recursordist/ws-recursor.cc @@ -431,10 +431,6 @@ static void apiServerZoneDetailGET(HttpRequest* req, HttpResponse* resp) static void apiServerSearchData(HttpRequest* req, HttpResponse* resp) { - if (req->method != "GET") { - throw HttpMethodNotAllowedException(); - } - string qVar = req->getvars["q"]; if (qVar.empty()) { throw ApiException("Query q can't be blank"); @@ -476,10 +472,6 @@ static void apiServerSearchData(HttpRequest* req, HttpResponse* resp) static void apiServerCacheFlush(HttpRequest* req, HttpResponse* resp) { - if (req->method != "PUT") { - throw HttpMethodNotAllowedException(); - } - DNSName canon = apiNameToDNSName(req->getvars["domain"]); bool subtree = req->getvars.count("subtree") > 0 && req->getvars["subtree"] == "true"; uint16_t qtype = 0xffff; @@ -493,12 +485,8 @@ static void apiServerCacheFlush(HttpRequest* req, HttpResponse* resp) {"result", "Flushed cache."}}); } -static void apiServerRPZStats(HttpRequest* req, HttpResponse* resp) +static void apiServerRPZStats(HttpRequest* /* req */, HttpResponse* resp) { - if (req->method != "GET") { - throw HttpMethodNotAllowedException(); - } - auto luaconf = g_luaconfs.getLocal(); auto numZones = luaconf->dfe.size(); @@ -531,10 +519,6 @@ static void prometheusMetrics(HttpRequest* req, HttpResponse* resp) { static MetricDefinitionStorage s_metricDefinitions; - if (req->method != "GET") { - throw HttpMethodNotAllowedException(); - } - std::ostringstream output; // Argument controls disabling of any stats. So