projects
/
dnssec-prover
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
7d04006
)
Refuse to include \s in the JSON output of a TXT record
author
Matt Corallo
<git@bluematt.me>
Mon, 26 Feb 2024 03:02:21 +0000
(
03:02
+0000)
committer
Matt Corallo
<git@bluematt.me>
Mon, 26 Feb 2024 20:44:36 +0000
(20:44 +0000)
src/rr.rs
patch
|
blob
|
history
diff --git
a/src/rr.rs
b/src/rr.rs
index f7faef51b58520d5600e0e106952a1f253ca53d8..86f5a807e12accf5504243fb1e145871b5775aa7 100644
(file)
--- 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);
}
}