From c5dc96a2b5595702615549b7740b04c4d954b724 Mon Sep 17 00:00:00 2001 From: Simone Margaritelli Date: Thu, 2 Nov 2023 13:45:22 +0100 Subject: [PATCH] new: response headers are now checked against --http-success-string as well as the body --- src/plugins/http/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/http/mod.rs b/src/plugins/http/mod.rs index eaf5994..6e5c230 100644 --- a/src/plugins/http/mod.rs +++ b/src/plugins/http/mod.rs @@ -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; } }