From 0b6423f9c99d9edf8c96fefd0f6c453859395aa1 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Mon, 30 Sep 2013 00:03:24 +0200 Subject: Import Nagios Plugins site Import the Nagios Plugins web site, Cronjobs, infrastructure scripts, and configuration files. --- ...5-nagios-plugins-1.4.12-ommit-default-port.patch | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 web/attachments/291715-nagios-plugins-1.4.12-ommit-default-port.patch (limited to 'web/attachments/291715-nagios-plugins-1.4.12-ommit-default-port.patch') diff --git a/web/attachments/291715-nagios-plugins-1.4.12-ommit-default-port.patch b/web/attachments/291715-nagios-plugins-1.4.12-ommit-default-port.patch new file mode 100644 index 0000000..c43e6ed --- /dev/null +++ b/web/attachments/291715-nagios-plugins-1.4.12-ommit-default-port.patch @@ -0,0 +1,21 @@ +--- nagios-plugins-1.4.12-orig/plugins/check_http.c 2008-05-07 12:02:42.000000000 +0200 ++++ nagios-plugins-1.4.12-ommit-default-port/plugins/check_http.c 2008-09-02 10:32:30.000000000 +0200 +@@ -753,7 +753,17 @@ + + /* optionally send the host header info */ + if (host_name) +- asprintf (&buf, "%sHost: %s:%d\r\n", buf, host_name, server_port); ++ { ++ /* Ommit the server port if it's the standard port (80 for http and 443 for https). */ ++ /* Some applications like wordpress do a redirect to a portless host if you named */ ++ /* a portnumber like www.wordpress-thingy.invalid:80. It will redirect to */ ++ /* www.wordpress-thingy.invalid and check_http adds the port number in the next */ ++ /* http call again resulting in a "redirection creates an infinite loop" */ ++ 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) { -- cgit v1.2.3-74-g34f1