[monitoring-plugins] I had to make a couple of small changes.

Sven Nierlein git at monitoring-plugins.org
Sun Sep 18 20:50:10 CEST 2022


    Module: monitoring-plugins
    Branch: master
    Commit: e2e405596a070ec3b830696ecf574ee3a243c7b1
    Author: John C. Frickson <jfrickson at nagios.com>
 Committer: Sven Nierlein <sven at nierlein.org>
      Date: Mon Nov 21 22:40:39 2016 +0100
       URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=e2e4055

I had to make a couple of small changes.

---

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

diff --git a/plugins/check_http.c b/plugins/check_http.c
index 59755ac..fb38bc5 100644
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
@@ -1363,10 +1363,9 @@ check_http (void)
 #define HD2 URI_HTTP "://" URI_HOST "/" URI_PATH
 #define HD3 URI_HTTP "://" URI_HOST ":" URI_PORT
 #define HD4 URI_HTTP "://" URI_HOST
-#define HD5 URI_PATH
 /* relative reference redirect like //www.site.org/test https://tools.ietf.org/html/rfc3986 */
-#define HD6 "//" URI_HOST "/" URI_PATH
-
+#define HD5 "//" URI_HOST "/" URI_PATH
+#define HD5 URI_PATH
 
 void
 redir (char *pos, char *status_line)
@@ -1443,7 +1442,8 @@ redir (char *pos, char *status_line)
       use_ssl = server_type_check (type);
       i = server_port_check (use_ssl);
     }
-    else if (sscanf (pos, HD6, addr, url) == 2) {
+    /* URI_HTTP, URI_HOST, URI_PATH */
+    else if (sscanf (pos, HD5, addr, url) == 2) {
       if(use_ssl){
         strcpy (type,"https");
       }
@@ -1456,7 +1456,7 @@ redir (char *pos, char *status_line)
     }
 
     /* URI_PATH */
-    else if (sscanf (pos, HD5, url) == 1) {
+    else if (sscanf (pos, HD6, url) == 1) {
       /* relative url */
       if ((url[0] != '/')) {
         if ((x = strrchr(server_url, '/')))



More information about the Commits mailing list