mirror of
https://github.com/aljazceru/pkdns.git
synced 2025-12-17 05:54:21 +01:00
fix: panic when empty question qname;
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -1075,7 +1075,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "pkdns"
|
||||
version = "0.2.1"
|
||||
version = "0.2.2"
|
||||
dependencies = [
|
||||
"any-dns",
|
||||
"chrono",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "pkdns"
|
||||
version = "0.2.1"
|
||||
version = "0.2.2"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
@@ -83,6 +83,9 @@ impl PkarrResolver {
|
||||
}
|
||||
let question = question_opt.unwrap();
|
||||
let labels = question.qname.get_labels();
|
||||
if labels.len() == 0 {
|
||||
return Err("No label in question.qname.".into());
|
||||
};
|
||||
|
||||
let raw_pubkey = labels.last().unwrap().to_string();
|
||||
let parsed_option = Self::parse_pkarr_uri(&raw_pubkey);
|
||||
|
||||
Reference in New Issue
Block a user