Skip to content

Commit

Permalink
fix: removed AllFieldInfo trim newline char to be same ScriptBlock va…
Browse files Browse the repository at this point in the history
…lue AllFieldInfo and Details #1189
  • Loading branch information
hitenkoku committed Oct 14, 2023
1 parent bc7a325 commit a727690
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/detections/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pub fn value_to_string(value: &Value) -> Option<String> {
Value::Null => Option::None,
Value::Bool(b) => Option::Some(b.to_string()),
Value::Number(n) => Option::Some(n.to_string()),
Value::String(s) => Option::Some(s.trim().to_string()),
Value::String(s) => Option::Some(s.to_string()),
Value::Array(_) => Option::None,
Value::Object(_) => Option::None,
}
Expand Down Expand Up @@ -448,7 +448,7 @@ fn _collect_recordinfo<'a>(
// 一番子の要素の値しか収集しない
let strval = value_to_string(value);
if let Some(strval) = strval {
let strval = strval.trim().chars().fold(String::default(), |mut acc, c| {
let strval = strval.chars().fold(String::default(), |mut acc, c| {
if (c.is_control() || c.is_ascii_whitespace())
&& !['\r', '\n', '\t'].contains(&c)
{
Expand Down

0 comments on commit a727690

Please sign in to comment.