diff options
Diffstat (limited to 'plugins/check_http.c')
-rw-r--r-- | plugins/check_http.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/plugins/check_http.c b/plugins/check_http.c index f8ec853..36f3b25 100644 --- a/plugins/check_http.c +++ b/plugins/check_http.c | |||
@@ -1364,6 +1364,9 @@ check_http (void) | |||
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 | 1366 | #define HD5 URI_PATH |
1367 | /* relative reference redirect like //www.site.org/test https://tools.ietf.org/html/rfc3986 */ | ||
1368 | #define HD6 "//" URI_HOST "/" URI_PATH | ||
1369 | |||
1367 | 1370 | ||
1368 | void | 1371 | void |
1369 | redir (char *pos, char *status_line) | 1372 | redir (char *pos, char *status_line) |
@@ -1440,6 +1443,21 @@ redir (char *pos, char *status_line) | |||
1440 | use_ssl = server_type_check (type); | 1443 | use_ssl = server_type_check (type); |
1441 | i = server_port_check (use_ssl); | 1444 | i = server_port_check (use_ssl); |
1442 | } | 1445 | } |
1446 | else if (sscanf (pos, HD6, addr, url) == 2) { | ||
1447 | //get type from | ||
1448 | if(use_ssl){ | ||
1449 | //i = server_port_check (use_ssl); | ||
1450 | strcpy (type,"https"); | ||
1451 | } | ||
1452 | //else if(sscanf(server_url,URI_HTTP,type)==1 ){ | ||
1453 | //} | ||
1454 | else{ | ||
1455 | strcpy (type, server_type); | ||
1456 | } | ||
1457 | xasprintf (&url, "/%s", url); | ||
1458 | use_ssl = server_type_check (type); | ||
1459 | i = server_port_check (use_ssl); | ||
1460 | } | ||
1443 | 1461 | ||
1444 | /* URI_PATH */ | 1462 | /* URI_PATH */ |
1445 | else if (sscanf (pos, HD5, url) == 1) { | 1463 | else if (sscanf (pos, HD5, url) == 1) { |