X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Frr.rs;h=86f5a807e12accf5504243fb1e145871b5775aa7;hb=99c90e3e3a77d431e3c6b7149aa43f93a793f579;hp=1755685cabb527075526cb8ec14a28d490117c1a;hpb=91c19b82695c29881ab5b809c681be786b942f09;p=dnssec-prover diff --git a/src/rr.rs b/src/rr.rs index 1755685..86f5a80 100644 --- a/src/rr.rs +++ b/src/rr.rs @@ -65,7 +65,7 @@ impl TryFrom for Name { if label.len() > 63 { return Err(()); } } - Ok(Name(s)) + Ok(Name(s.to_ascii_lowercase())) } } impl TryFrom<&str> for Name { @@ -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); } }