From 604da4939252620a6c35f5f3f5703eb9e42e65bc Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Tue, 2 Oct 2007 13:51:41 +0000 Subject: Fix regression in 1.4.10 where following redirects to relative URLs on virtual hosts failed if both "-H" and "-I" were specified (noted by Rodrigo A. G. Schichaschwili on nagiosplug-devel@) git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1804 f882894a-f735-0410-b71e-b25c423dba1c --- plugins/check_http.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'plugins/check_http.c') diff --git a/plugins/check_http.c b/plugins/check_http.c index b371cd64..24819359 100644 --- a/plugins/check_http.c +++ b/plugins/check_http.c @@ -151,7 +151,7 @@ main (int argc, char **argv) if (display_html == TRUE) printf ("", - use_ssl ? "https" : "http", server_address, + use_ssl ? "https" : "http", host_name ? host_name : server_address, server_port, server_url); /* initialize alarm signal handling, set socket timeout, start timer */ @@ -1155,7 +1155,7 @@ redir (char *pos, char *status_line) } i = server_port; strcpy (type, server_type); - strcpy (addr, server_address); + strcpy (addr, host_name ? host_name : server_address); } else { @@ -1204,8 +1204,8 @@ redir (char *pos, char *status_line) display_html ? "" : ""); if (verbose) - printf (_("Redirection to %s://%s:%d%s\n"), server_type, server_address, - server_port, server_url); + printf (_("Redirection to %s://%s:%d%s\n"), server_type, + host_name ? host_name : server_address, server_port, server_url); check_http (); } -- cgit v1.2.3