Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
QpxDesign committed Mar 8, 2024
1 parent 0464021 commit c996423
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
workspace = { members = [ "tests","tests/obfuscate_access_log_ips"] }
[package]
name = "ngxav"
version = "0.5.4"
version = "0.5.5"
edition = "2021"
license = "MIT"
description = "Search through NGINX logs with advanced filters and support for displaying analytics about your selected log entries"
Expand Down
34 changes: 31 additions & 3 deletions src/utils/read_folder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,42 @@ pub fn read_folder(file_path: String) -> Vec<String> {
let a = std::io::BufReader::new(
fs::File::open(path.as_ref().unwrap().path().to_str().unwrap()).unwrap(),
);
if path.unwrap().path().to_str().unwrap().contains(".gz") {
if path
.as_ref()
.unwrap()
.path()
.to_str()
.unwrap()
.contains("error")
{
} else if path.unwrap().path().to_str().unwrap().contains(".gz") {
let d = GzDecoder::new(a);
for line in io::BufReader::new(d).lines() {
lines.push(line.unwrap().to_string());
if line
.as_ref()
.expect("WOOP")
.chars()
.filter(|c| *c == '"')
.count()
> 6
&& line.as_ref().expect("WOOP").len() > 20
{
lines.push(line.unwrap().to_string());
}
}
} else {
for line in io::BufReader::new(a).lines() {
lines.push(line.unwrap().to_string());
if line
.as_ref()
.expect("WOOP")
.chars()
.filter(|c| *c == '"')
.count()
> 6
&& line.as_ref().expect("WOOP").len() > 20
{
lines.push(line.unwrap().to_string());
}
}
}
}
Expand Down

0 comments on commit c996423

Please sign in to comment.