Code

Relative redirects not followed correctly (854131 - John Sivak)
authorTon Voon <tonvoon@users.sourceforge.net>
Thu, 11 Dec 2003 10:00:07 +0000 (10:00 +0000)
committerTon Voon <tonvoon@users.sourceforge.net>
Thu, 11 Dec 2003 10:00:07 +0000 (10:00 +0000)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@788 f882894a-f735-0410-b71e-b25c423dba1c

plugins/check_http.c

index 4dcf1a5a8db8fa0ea0c33cfa32b8b786b1c7b8c3..8e45e88d5bec3593cbe15a3ed5fcb483382bc6a9 100644 (file)
@@ -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);