[monitoring-plugins] Fix chunked header detection regex

Sven Nierlein git at monitoring-plugins.org
Sat Jan 7 18:40:13 CET 2023


    Module: monitoring-plugins
    Branch: master
    Commit: 3e63e61f6ae062fd1e8c8c962c0bb603cf88856c
    Author: RincewindsHat <12514511+RincewindsHat at users.noreply.github.com>
 Committer: Sven Nierlein <sven at nierlein.org>
      Date: Mon Nov 14 00:34:13 2022 +0100
       URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=3e63e61

Fix chunked header detection regex

---

 plugins/check_http.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/plugins/check_http.c b/plugins/check_http.c
index 3e021c5..1f7bd0b 100644
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
@@ -1257,10 +1257,10 @@ int check_http(void) {
 
   // At this point we should test if the content is chunked and unchunk it, so
   // it can be searched (and possibly printed)
-  const char *chunked_header_regex_string = "Transfer-Encoding:\\s*chunked\\s*"CRLF;
+  const char *chunked_header_regex_string = "Transfer-Encoding: *chunked *";
   regex_t chunked_header_regex;
 
-  if (regcomp(&chunked_header_regex, chunked_header_regex_string, 0)) {
+  if (regcomp(&chunked_header_regex, chunked_header_regex_string, REG_ICASE)) {
     die(STATE_UNKNOWN, "HTTP %s: %s\n", state_text(STATE_UNKNOWN), "Failed to compile chunked_header_regex regex");
   }
 



More information about the Commits mailing list