summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn C. Frickson <jfrickson@nagios.com>2016-11-21 21:40:39 (GMT)
committerSven Nierlein <sven@nierlein.org>2022-09-18 18:42:26 (GMT)
commite2e405596a070ec3b830696ecf574ee3a243c7b1 (patch)
tree99e42b0b3099e394e9b5aa94634fa3e25a0647a8
parentd57d2b0bdda192dc50e17ebeb8becfe249c3f8e3 (diff)
downloadmonitoring-plugins-e2e4055.tar.gz
I had to make a couple of small changes.
-rw-r--r--plugins/check_http.c10
1 files 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)
1363#define HD2 URI_HTTP "://" URI_HOST "/" URI_PATH 1363#define HD2 URI_HTTP "://" URI_HOST "/" URI_PATH
1364#define HD3 URI_HTTP "://" URI_HOST ":" URI_PORT 1364#define HD3 URI_HTTP "://" URI_HOST ":" URI_PORT
1365#define HD4 URI_HTTP "://" URI_HOST 1365#define HD4 URI_HTTP "://" URI_HOST
1366#define HD5 URI_PATH
1367/* relative reference redirect like //www.site.org/test https://tools.ietf.org/html/rfc3986 */ 1366/* relative reference redirect like //www.site.org/test https://tools.ietf.org/html/rfc3986 */
1368#define HD6 "//" URI_HOST "/" URI_PATH 1367#define HD5 "//" URI_HOST "/" URI_PATH
1369 1368#define HD5 URI_PATH
1370 1369
1371void 1370void
1372redir (char *pos, char *status_line) 1371redir (char *pos, char *status_line)
@@ -1443,7 +1442,8 @@ redir (char *pos, char *status_line)
1443 use_ssl = server_type_check (type); 1442 use_ssl = server_type_check (type);
1444 i = server_port_check (use_ssl); 1443 i = server_port_check (use_ssl);
1445 } 1444 }
1446 else if (sscanf (pos, HD6, addr, url) == 2) { 1445 /* URI_HTTP, URI_HOST, URI_PATH */
1446 else if (sscanf (pos, HD5, addr, url) == 2) {
1447 if(use_ssl){ 1447 if(use_ssl){
1448 strcpy (type,"https"); 1448 strcpy (type,"https");
1449 } 1449 }
@@ -1456,7 +1456,7 @@ redir (char *pos, char *status_line)
1456 } 1456 }
1457 1457
1458 /* URI_PATH */ 1458 /* URI_PATH */
1459 else if (sscanf (pos, HD5, url) == 1) { 1459 else if (sscanf (pos, HD6, url) == 1) {
1460 /* relative url */ 1460 /* relative url */
1461 if ((url[0] != '/')) { 1461 if ((url[0] != '/')) {
1462 if ((x = strrchr(server_url, '/'))) 1462 if ((x = strrchr(server_url, '/')))