summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a24c8f0)
raw | patch | inline | side by side (parent: a24c8f0)
author | Holger Weiss <hweiss@users.sourceforge.net> | |
Tue, 2 Sep 2008 11:26:31 +0000 (11:26 +0000) | ||
committer | Holger Weiss <hweiss@users.sourceforge.net> | |
Tue, 2 Sep 2008 11:26:31 +0000 (11:26 +0000) |
explicitly specified in our "Host:" header line. Therefore, we now specify the
port only if we're using a non-default port (Erik Wasser - 2082501).
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2053 f882894a-f735-0410-b71e-b25c423dba1c
port only if we're using a non-default port (Erik Wasser - 2082501).
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2053 f882894a-f735-0410-b71e-b25c423dba1c
THANKS.in | patch | blob | history | |
plugins/check_http.c | patch | blob | history |
diff --git a/THANKS.in b/THANKS.in
index 56bc7ee212bb62cd2ab2ae7e480e9f04816ef318..a003fa8162f301dfb1ee4b2608ab81c418475343 100644 (file)
--- a/THANKS.in
+++ b/THANKS.in
Rob Windsor
Hilko Bengen
Sven Nierlein
+Erik Wasser
diff --git a/plugins/check_http.c b/plugins/check_http.c
index 718fb840cb888f8613e215f62839ac973183673c..69ed2fa91031f0bf89eccd15734661e69cba45da 100644 (file)
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
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);
+ if (host_name) {
+ /*
+ * Specify the port only if we're using a non-default port (see RFC 2616,
+ * 14.23). Some server applications/configurations cause trouble if the
+ * (default) port is explicitly specified in the "Host:" header line.
+ */
+ if ((use_ssl == FALSE && server_port == HTTP_PORT) ||
+ (use_ssl == TRUE && server_port == HTTPS_PORT))
+ asprintf (&buf, "%sHost: %s\r\n", buf, host_name);
+ else
+ asprintf (&buf, "%sHost: %s:%d\r\n", buf, host_name, server_port);
+ }
/* optionally send any other header tag */
if (http_opt_headers_count) {