summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e8c7d1b)
raw | patch | inline | side by side (parent: e8c7d1b)
author | Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> | |
Mon, 1 Sep 2008 14:04:04 +0000 (14:04 +0000) | ||
committer | Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> | |
Mon, 1 Sep 2008 14:04:04 +0000 (14:04 +0000) |
This reverts commit 2030
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2050 f882894a-f735-0410-b71e-b25c423dba1c
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2050 f882894a-f735-0410-b71e-b25c423dba1c
NEWS | patch | blob | history | |
THANKS.in | patch | blob | history | |
plugins/check_http.c | patch | blob | history |
index c2be90293dc8394932ce4a5291e689bf5d2863c4..96c459172988ae92ad5a07e2097a3408101dd56e 100644 (file)
--- a/NEWS
+++ b/NEWS
check_procs now captures stderr in external command and adds to plugin output
check_snmp now only prints perfdata for non numeric values (#1867716)
check_icmp now supports packet size modification
- check_http now sends the Host header first to fix 301s on servers with vitrual hosts (Michael Harris).
check_http -e now accepts a comma-delimited list of expected status codes
libtap now included with this distribution for easier testing. Run ./configure with --enable-libtap
diff --git a/THANKS.in b/THANKS.in
index e63e9f626125816a19fd14aa8906ee49c9b7d2ac..56bc7ee212bb62cd2ab2ae7e480e9f04816ef318 100644 (file)
--- a/THANKS.in
+++ b/THANKS.in
Christian Schneemann
Rob Windsor
Hilko Bengen
-Michael Harris
Sven Nierlein
diff --git a/plugins/check_http.c b/plugins/check_http.c
index 4a3d692b39d12da49f491e056477e47ff6ead2e4..718fb840cb888f8613e215f62839ac973183673c 100644 (file)
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
}
#endif /* HAVE_SSL */
- /* If a hostname is provided, use HTTP/1.1 and send the hostname before the
- * Useragent. This fixes an issue with getting 301 responses from servers
- * with virtual hosts */
- if (host_name)
- asprintf (&buf, "%s %s HTTP/1.1\r\nHost: %s\r\n%s\r\n", http_method, server_url, host_name, user_agent);
- else
- asprintf (&buf, "%s %s HTTP/1.0\r\n%s\r\n", http_method, server_url, user_agent);
+ asprintf (&buf, "%s %s HTTP/1.0\r\n%s\r\n", http_method, server_url, user_agent);
/* tell HTTP/1.1 servers not to keep the connection alive */
asprintf (&buf, "%sConnection: close\r\n", buf);
+ /* optionally send the host header info */
+ if (host_name)
+ asprintf (&buf, "%sHost: %s:%d\r\n", buf, host_name, server_port);
+
/* optionally send any other header tag */
if (http_opt_headers_count) {
for (i = 0; i < http_opt_headers_count ; i++) {