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