From 99c90e3e3a77d431e3c6b7149aa43f93a793f579 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 26 Feb 2024 03:02:21 +0000 Subject: [PATCH] Refuse to include \s in the JSON output of a TXT record --- src/rr.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } } -- 2.39.5