[MINOR] add support for "stats refresh <interval>"
Sometimes it may be desirable to automatically refresh the
stats page. Most browsers support the "Refresh:" header with
an interval in seconds. Specifying "stats refresh xxx" will
automatically add this header.
diff --git a/src/proto_http.c b/src/proto_http.c
index 1042081..8ebdc61 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -3451,8 +3451,13 @@
"HTTP/1.0 200 OK\r\n"
"Cache-Control: no-cache\r\n"
"Connection: close\r\n"
- "Content-Type: text/html\r\n"
- "\r\n");
+ "Content-Type: text/html\r\n");
+
+ if (s->be->uri_auth->refresh > 0)
+ chunk_printf(&msg, sizeof(trash), "Refresh: %d\r\n",
+ s->be->uri_auth->refresh);
+
+ chunk_printf(&msg, sizeof(trash), "\r\n");
s->txn.status = 200;
client_retnclose(s, &msg); // send the start of the response.