From: Matt Corallo Date: Mon, 26 Feb 2024 03:02:21 +0000 (+0000) Subject: Refuse to include \s in the JSON output of a TXT record X-Git-Tag: v0.5.4~49 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=99c90e3e3a77d431e3c6b7149aa43f93a793f579;p=dnssec-prover Refuse to include \s in the JSON output of a TXT record --- diff --git a/src/rr.rs b/src/rr.rs index f7faef5..86f5a80 100644 --- a/src/rr.rs +++ b/src/rr.rs @@ -247,7 +247,7 @@ impl StaticRecord for Txt { fn name(&self) -> &Name { &self.name } fn json(&self) -> String { if let Ok(s) = core::str::from_utf8(&self.data) { - if s.chars().all(|c| !c.is_control() && c != '"') { + if s.chars().all(|c| !c.is_control() && c != '"' && c != '\\') { return format!("{{\"type\":\"txt\",\"name\":\"{}\",\"contents\":\"{}\"}}", self.name.0, s); } }