]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stats/htx: Don't add "Connection: close" header anymore in stats responses
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 29 Mar 2019 15:13:55 +0000 (16:13 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 12 Apr 2019 20:06:53 +0000 (22:06 +0200)
On the client side, as far as possible, we will try to keep connection
alive. So, in most of cases, this header will be removed. So it is better to not
add it at all. If finally the connection must be closed, the header will be
added by the mux h1.

No need to backport this patch.

src/stats.c

index 965fe4299dad0a706716a8002f15a413d82649f4..346c62912b3bff192eeec2ac374f8f5665a4a17e 100644 (file)
@@ -3114,8 +3114,7 @@ static int stats_send_htx_headers(struct stream_interface *si, struct htx *htx)
                goto full;
        sl->info.res.status = 200;
 
-       if (!htx_add_header(htx, ist("Cache-Control"), ist("no-cache")) ||
-           !htx_add_header(htx, ist("Connection"), ist("close")))
+       if (!htx_add_header(htx, ist("Cache-Control"), ist("no-cache")))
                goto full;
        if (appctx->ctx.stats.flags & STAT_FMT_HTML) {
                if (!htx_add_header(htx, ist("Content-Type"), ist("text/html")))
@@ -3191,7 +3190,6 @@ static int stats_send_htx_redirect(struct stream_interface *si, struct htx *htx)
        sl->info.res.status = 303;
 
        if (!htx_add_header(htx, ist("Cache-Control"), ist("no-cache")) ||
-           !htx_add_header(htx, ist("Connection"), ist("close")) ||
            !htx_add_header(htx, ist("Content-Type"), ist("text/plain")) ||
            !htx_add_header(htx, ist("Content-Length"), ist("0")) ||
            !htx_add_header(htx, ist("Location"), ist2(trash.area, trash.data)))