From e1b72559ca6185adb96e0dd25bd91307421b63e5 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Wed, 2 Oct 2019 11:14:50 +0200 Subject: [PATCH] dnsdist: Also lowercase custom DoH header names for early responses --- pdns/dnsdist-lua-bindings.cc | 2 +- regression-tests.dnsdist/test_DOH.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pdns/dnsdist-lua-bindings.cc b/pdns/dnsdist-lua-bindings.cc index efa8d94b7..6a01adf1f 100644 --- a/pdns/dnsdist-lua-bindings.cc +++ b/pdns/dnsdist-lua-bindings.cc @@ -374,7 +374,7 @@ void setupLuaBindings(bool client) if (customHeaders) { headers = std::vector>(); for (const auto& header : *customHeaders) { - headers->push_back({ header.first, header.second }); + headers->push_back({ boost::to_lower_copy(header.first), header.second }); } } return std::make_shared(regex, status, content, headers); diff --git a/regression-tests.dnsdist/test_DOH.py b/regression-tests.dnsdist/test_DOH.py index 4bd0089e6..bee0c29fc 100644 --- a/regression-tests.dnsdist/test_DOH.py +++ b/regression-tests.dnsdist/test_DOH.py @@ -152,7 +152,7 @@ class TestDOH(DNSDistDOHTest): addDOHLocal("127.0.0.1:%s", "%s", "%s", { "/" }, {customResponseHeaders={["access-control-allow-origin"]="*",["user-agent"]="derp",["UPPERCASE"]="VaLuE"}}) dohFE = getDOHFrontend(0) - dohFE:setResponsesMap({newDOHResponseMapEntry('^/coffee$', 418, 'C0FFEE', {['foo']='bar'})}) + dohFE:setResponsesMap({newDOHResponseMapEntry('^/coffee$', 418, 'C0FFEE', {['FoO']='bar'})}) addAction("drop.doh.tests.powerdns.com.", DropAction()) addAction("refused.doh.tests.powerdns.com.", RCodeAction(DNSRCode.REFUSED)) -- 2.40.0