mirror of
https://github.com/aljazceru/pkdns.git
synced 2025-12-17 22:14:27 +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]]
|
[[package]]
|
||||||
name = "pkdns"
|
name = "pkdns"
|
||||||
version = "0.2.1"
|
version = "0.2.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"any-dns",
|
"any-dns",
|
||||||
"chrono",
|
"chrono",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "pkdns"
|
name = "pkdns"
|
||||||
version = "0.2.1"
|
version = "0.2.2"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# 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 question = question_opt.unwrap();
|
||||||
let labels = question.qname.get_labels();
|
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 raw_pubkey = labels.last().unwrap().to_string();
|
||||||
let parsed_option = Self::parse_pkarr_uri(&raw_pubkey);
|
let parsed_option = Self::parse_pkarr_uri(&raw_pubkey);
|
||||||
|
|||||||
Reference in New Issue
Block a user