summaryrefslogtreecommitdiffstats
path: root/web/attachments/331884-http_compliance.patch
blob: b2e3e44180809ed2b713b9d8ec7578a705e8fb27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
diff --git a/plugins/check_http.c b/plugins/check_http.c
index 79f6adf..a66ee9a 100644
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
@@ -802,11 +802,11 @@ check_http (void)
 
   asprintf (&buf, "%s %s %s\r\n%s\r\n", http_method, server_url, host_name ? "H
 
-  /* 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) {
+    /* tell HTTP/1.1 servers not to keep the connection alive */
+    asprintf (&buf, "%sConnection: close\r\n", buf);
+
     /*
      * 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