Loading netwerk/dns/TRR.cpp +8 −4 Original line number Diff line number Diff line Loading @@ -873,10 +873,14 @@ nsresult TRR::DohDecode(nsCString& aHost) { return NS_ERROR_ILLEGAL_VALUE; } // We check if the qname matches the host or the FQDN version of the host if (qname.Equals(aHost) || (aHost.Length() == qname.Length() + 1 && aHost.Last() == '.' && StringBeginsWith(aHost, qname))) { // We check if the qname is a case-insensitive match for the host or the // FQDN version of the host bool responseMatchesQuestion = (qname.Length() == aHost.Length() || (aHost.Length() == qname.Length() + 1 && aHost.Last() == '.')) && qname.Compare(aHost.BeginReading(), true, qname.Length()) == 0; if (responseMatchesQuestion) { // RDATA // - A (TYPE 1): 4 bytes // - AAAA (TYPE 28): 16 bytes Loading netwerk/test/unit/test_trr_case_sensitivity.js +12 −0 Original line number Diff line number Diff line Loading @@ -125,5 +125,17 @@ add_task(async function test_trr_casing() { ]); await new TRRDNSListener("a.test.com", "8.8.8.8"); await trrServer.registerDoHAnswers("CAPITAL.COM", "A", [ { name: "capital.com", ttl: 55, type: "A", flush: false, data: "2.2.2.2", }, ]); await new TRRDNSListener("CAPITAL.COM", "2.2.2.2"); await new TRRDNSListener("CAPITAL.COM.", "2.2.2.2"); await trrServer.stop(); }); Loading
netwerk/dns/TRR.cpp +8 −4 Original line number Diff line number Diff line Loading @@ -873,10 +873,14 @@ nsresult TRR::DohDecode(nsCString& aHost) { return NS_ERROR_ILLEGAL_VALUE; } // We check if the qname matches the host or the FQDN version of the host if (qname.Equals(aHost) || (aHost.Length() == qname.Length() + 1 && aHost.Last() == '.' && StringBeginsWith(aHost, qname))) { // We check if the qname is a case-insensitive match for the host or the // FQDN version of the host bool responseMatchesQuestion = (qname.Length() == aHost.Length() || (aHost.Length() == qname.Length() + 1 && aHost.Last() == '.')) && qname.Compare(aHost.BeginReading(), true, qname.Length()) == 0; if (responseMatchesQuestion) { // RDATA // - A (TYPE 1): 4 bytes // - AAAA (TYPE 28): 16 bytes Loading
netwerk/test/unit/test_trr_case_sensitivity.js +12 −0 Original line number Diff line number Diff line Loading @@ -125,5 +125,17 @@ add_task(async function test_trr_casing() { ]); await new TRRDNSListener("a.test.com", "8.8.8.8"); await trrServer.registerDoHAnswers("CAPITAL.COM", "A", [ { name: "capital.com", ttl: 55, type: "A", flush: false, data: "2.2.2.2", }, ]); await new TRRDNSListener("CAPITAL.COM", "2.2.2.2"); await new TRRDNSListener("CAPITAL.COM.", "2.2.2.2"); await trrServer.stop(); });