Skip to content

Commit

Permalink
added headers to regex filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
epi052 committed May 11, 2024
1 parent 87b6589 commit 50b23c0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/filters/regex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@ impl FeroxFilter for RegexFilter {
log::trace!("enter: should_filter_response({:?} {})", self, response);

let result = self.compiled.is_match(response.text());
let other = response.headers().iter().any(|(k, v)| {
self.compiled.is_match(k.as_str()) || self.compiled.is_match(v.to_str().unwrap_or(""))
});

log::trace!("exit: should_filter_response -> {}", result);
log::trace!("exit: should_filter_response -> {}", result || other);

result
result || other
}

/// Compare one SizeFilter to another
Expand Down

0 comments on commit 50b23c0

Please sign in to comment.