aboutsummaryrefslogtreecommitdiff
path: root/plugins/check_http.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_http.c')
-rw-r--r--plugins/check_http.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/plugins/check_http.c b/plugins/check_http.c
index f8ec853b..36f3b253 100644
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
@@ -1364,6 +1364,9 @@ check_http (void)
#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
+
void
redir (char *pos, char *status_line)
@@ -1440,6 +1443,21 @@ 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) {
+ //get type from
+ if(use_ssl){
+ //i = server_port_check (use_ssl);
+ strcpy (type,"https");
+ }
+ //else if(sscanf(server_url,URI_HTTP,type)==1 ){
+ //}
+ else{
+ strcpy (type, server_type);
+ }
+ xasprintf (&url, "/%s", url);
+ use_ssl = server_type_check (type);
+ i = server_port_check (use_ssl);
+ }
/* URI_PATH */
else if (sscanf (pos, HD5, url) == 1) {