From: Ton Voon Date: Thu, 11 Dec 2003 10:00:07 +0000 (+0000) Subject: Relative redirects not followed correctly (854131 - John Sivak) X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c9575e15e4cd5e385a8040052d48f140804c10c6;p=nagiosplug.git Relative redirects not followed correctly (854131 - John Sivak) git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@788 f882894a-f735-0410-b71e-b25c423dba1c --- diff --git a/plugins/check_http.c b/plugins/check_http.c index 4dcf1a5..8e45e88 100644 --- a/plugins/check_http.c +++ b/plugins/check_http.c @@ -838,9 +838,9 @@ redir (char *pos, char *status_line) else if (sscanf (pos, HD5, url) == 1) { /* relative url */ if ((url[0] != '/')) { - if ((x = strrchr(url, '/'))) + if ((x = strrchr(server_url, '/'))) *x = '\0'; - asprintf (&server_url, "%s/%s", server_url, url); + asprintf (&url, "%s/%s", server_url, url); } i = server_port; strcpy (type, server_type);