From ee1c1a0e62782d2c8eba543388699328859eab4a Mon Sep 17 00:00:00 2001 From: cn-kali-team Date: Fri, 16 Aug 2024 14:27:57 +0800 Subject: [PATCH] fix bug --- CHANGELOG.md | 6 ++++++ engine/src/common/http.rs | 2 +- engine/src/info/cse.rs | 2 +- engine/src/serde_format.rs | 13 +++++++++++++ observer_ward/src/helper.rs | 6 +++++- 5 files changed, 26 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0dd17ade..b711e34b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Change Log +## [2024.8.16] - 2024.8.16 + +### Fixes + +- 修复nuclei字段`cve-id`为`null`时解析错误 +- 修复`aarch64`和`arm`架构自更新下载目标文件错误 ## [2024.8.15] - 2024.8.15 diff --git a/engine/src/common/http.rs b/engine/src/common/http.rs index dbcc252b..d2470f55 100644 --- a/engine/src/common/http.rs +++ b/engine/src/common/http.rs @@ -57,7 +57,7 @@ impl HttpRecord { self.response = response.clone(); } // 补充默认路径 - let icon_sets = get_favicon_link(&response); + let icon_sets = get_favicon_link(response); for link in icon_sets { if self.skip.contains(&link) { continue; diff --git a/engine/src/info/cse.rs b/engine/src/info/cse.rs index b6dc694e..b59441ed 100644 --- a/engine/src/info/cse.rs +++ b/engine/src/info/cse.rs @@ -134,7 +134,7 @@ impl From for Vec { keyword.insert(vv); } "icon_hash" => { - hash.extend(vv.split(",").map(|x| x.to_string())); + hash.extend(vv.split(',').map(|x| x.to_string())); } _ => {} } diff --git a/engine/src/serde_format.rs b/engine/src/serde_format.rs index 98df0597..da508e37 100644 --- a/engine/src/serde_format.rs +++ b/engine/src/serde_format.rs @@ -28,6 +28,18 @@ pub mod string_vec_serde { let name: Vec = value.split_terminator(',').map(String::from).collect(); Ok(name) } + fn visit_none(self) -> Result + where + E: de::Error, + { + Ok(Vec::new()) + } + fn visit_unit(self) -> Result + where + E: de::Error, + { + self.visit_none() + } fn visit_seq(self, visitor: S) -> Result where S: de::SeqAccess<'de>, @@ -38,6 +50,7 @@ pub mod string_vec_serde { d.deserialize_any(StringToVec(PhantomData)) } } + #[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq)] #[serde(untagged)] pub enum Value { diff --git a/observer_ward/src/helper.rs b/observer_ward/src/helper.rs index 3c2a7143..6548105d 100644 --- a/observer_ward/src/helper.rs +++ b/observer_ward/src/helper.rs @@ -94,8 +94,12 @@ impl<'a> Helper<'a> { let mut download_name = "observer_ward_amd64"; if cfg!(target_os = "windows") { download_name = "observer_ward.exe"; - } else if cfg!(target_os = "linux") { + } else if cfg!(target_os = "linux") && cfg!(target_arch = "x86_64") { download_name = "observer_ward_amd64"; + } else if cfg!(target_os = "linux") && cfg!(target_arch = "aarch64") { + download_name = "observer_ward_aarch64"; + } else if cfg!(target_os = "linux") && cfg!(target_arch = "arm") { + download_name = "observer_ward_armv7"; } else if cfg!(target_os = "macos") && cfg!(target_arch = "x86_64") { download_name = "observer_ward_darwin"; } else if cfg!(target_os = "macos") && cfg!(target_arch = "aarch64") {