changed channel convert from case-sensitive to insensitive #685

This commit is contained in:
DastInDark
2022-09-07 10:22:36 +09:00
parent 49f744ff46
commit 26fe7dd2b2
2 changed files with 7 additions and 3 deletions

View File

@@ -25,6 +25,7 @@ use crate::filter;
use crate::yaml::ParseYaml;
use hashbrown::HashMap;
use serde_json::Value;
use std::ascii::AsciiExt;
use std::fmt::Write;
use std::path::Path;
@@ -264,7 +265,10 @@ impl Detection {
"%Channel%" => {
profile_converter.insert(
"%Channel%".to_string(),
CH_CONFIG.get(ch_str).unwrap_or(ch_str).to_string(),
CH_CONFIG
.get(&ch_str.to_ascii_lowercase())
.unwrap_or(ch_str)
.to_string(),
);
}
"%Level%" => {

View File

@@ -105,10 +105,10 @@ pub fn create_output_filter_config(path: &str) -> HashMap<String, String> {
return;
}
let tag_full_str = line[0].trim();
let tag_full_str = line[0].trim().to_ascii_lowercase();
let tag_replace_str = line[1].trim();
ret.insert(tag_full_str.to_owned(), tag_replace_str.to_owned());
ret.insert(tag_full_str, tag_replace_str.to_owned());
});
ret
}