summaryrefslogtreecommitdiffstats
path: root/web/attachments/291715-nagios-plugins-1.4.12-ommit-default-port.patch
diff options
context:
space:
mode:
Diffstat (limited to 'web/attachments/291715-nagios-plugins-1.4.12-ommit-default-port.patch')
-rw-r--r--web/attachments/291715-nagios-plugins-1.4.12-ommit-default-port.patch21
1 files changed, 21 insertions, 0 deletions
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 @@
1--- nagios-plugins-1.4.12-orig/plugins/check_http.c 2008-05-07 12:02:42.000000000 +0200
2+++ nagios-plugins-1.4.12-ommit-default-port/plugins/check_http.c 2008-09-02 10:32:30.000000000 +0200
3@@ -753,7 +753,17 @@
4
5 /* optionally send the host header info */
6 if (host_name)
7- asprintf (&buf, "%sHost: %s:%d\r\n", buf, host_name, server_port);
8+ {
9+ /* Ommit the server port if it's the standard port (80 for http and 443 for https). */
10+ /* Some applications like wordpress do a redirect to a portless host if you named */
11+ /* a portnumber like www.wordpress-thingy.invalid:80. It will redirect to */
12+ /* www.wordpress-thingy.invalid and check_http adds the port number in the next */
13+ /* http call again resulting in a "redirection creates an infinite loop" */
14+ if ((use_ssl == false && server_port == HTTP_PORT) || (use_ssl == true && server_port == HTTPS_PORT))
15+ asprintf (&buf, "%sHost: %s\r\n", buf, host_name);
16+ else
17+ asprintf (&buf, "%sHost: %s:%d\r\n", buf, host_name, server_port);
18+ }
19
20 /* optionally send any other header tag */
21 if (http_opt_headers_count) {