summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGalen Guyer <galen@galenguyer.com>2022-12-28 15:48:50 -0800
committerGalen Guyer <galen@galenguyer.com>2022-12-28 15:48:50 -0800
commit3e4c3d05ecba4506fd2e9bef9d816874d5bdfd62 (patch)
treebeb98399243d8b0f1200530f09f5620459d0cd4e
parentb4eeb12bbb7327bc0a9055a8c2f9312f91091bb8 (diff)
Mask SOA and NS recordsHEADmain
-rw-r--r--src/routes/v1/records.rs7
-rw-r--r--src/routes/v1/zones.rs4
2 files changed, 7 insertions, 4 deletions
diff --git a/src/routes/v1/records.rs b/src/routes/v1/records.rs
index f8dcc9a..83e8286 100644
--- a/src/routes/v1/records.rs
+++ b/src/routes/v1/records.rs
@@ -36,7 +36,12 @@ pub async fn get_records(
);
}
- let records = db::records::get_records(&pool, &zone.id).await.unwrap();
+ let records: Vec<db::models::Record> = db::records::get_records(&pool, &zone.id)
+ .await
+ .unwrap()
+ .into_iter()
+ .filter(|r| r.record_type != "SOA" && r.record_type != "NS")
+ .collect();
(StatusCode::OK, Json(json!(records)))
}
diff --git a/src/routes/v1/zones.rs b/src/routes/v1/zones.rs
index 7835911..8a554e5 100644
--- a/src/routes/v1/zones.rs
+++ b/src/routes/v1/zones.rs
@@ -16,9 +16,7 @@ use whois_rust::{WhoIs, WhoIsLookupOptions};
lazy_static! {
static ref NAMESERVERS: Vec<String> = Vec::from([
String::from("ns1.hostsdottxt.net."),
- String::from("ns2.hostsdottxt.net."),
- String::from("ns3.hostsdottxt.net."),
- String::from("ns4.hostsdottxt.net.")
+ String::from("ns2.hostsdottxt.net.")
]);
}