Skip to content

Commit

Permalink
new: response headers are now checked against --http-success-string a…
Browse files Browse the repository at this point in the history
…s well as the body
  • Loading branch information
evilsocket committed Nov 2, 2023
1 parent 6e4adc6 commit c5dc96a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/plugins/http/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,12 @@ impl HTTP {
} else {
String::new()
};
let headers = format!("{:?}", response.headers());
let body = response.text().await.unwrap_or(String::new());
let content_length = body.len();

if let Some(success_string) = self.success_string.as_ref() {
if !body.contains(success_string) {
if !body.contains(success_string) && !headers.contains(success_string) {
return None;
}
}
Expand Down

0 comments on commit c5dc96a

Please sign in to comment.