]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Be more consistent when processing DoH3 headers
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 21 Apr 2026 07:30:54 +0000 (09:30 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 25 Jun 2026 14:50:16 +0000 (16:50 +0200)
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
pdns/dnsdistdist/doh3.cc

index e0b1c780990b7d20f9c97a7e4669f5e900a3ee73..d24249955f3b6696d08c985d42f6a5f1455a6199 100644 (file)
@@ -868,7 +868,8 @@ static void processH3DataEvent(ClientState& clientState, DOH3Frontend& frontend,
         return;
       }
     }
-    if (headers.count("content-type") == 0 || headers.at("content-type") != "application/dns-message") {
+    auto contentTypeHeaderIt = headers.find("content-type");
+    if (contentTypeHeaderIt == headers.end() || contentTypeHeaderIt->second != "application/dns-message") {
       handleImmediateError("Unsupported content-type");
       return;
     }