summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS1
-rw-r--r--src/mod_status.c15
2 files changed, 16 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 75be21a7..79377476 100644
--- a/NEWS
+++ b/NEWS
@@ -69,6 +69,7 @@ NEWS
* [mod_extforward] reset cond_cache for scheme (fixes #1499)
* [mod_webdav] readdir POSIX compat (fixes #1826)
* [mod_expire] reset caching response headers for error docs (fixes #1919)
+ * [mod_status] page refresh option (fixes #2170)
- 1.4.39 - 2016-01-02
* [core] fix memset_s call (fixes #2698)
diff --git a/src/mod_status.c b/src/mod_status.c
index 82326281..955554cd 100644
--- a/src/mod_status.c
+++ b/src/mod_status.c
@@ -229,6 +229,21 @@ static handler_t mod_status_handle_server_status_html(server *srv, connection *c
" span.sortarrow { color: white; text-decoration: none; }\n"
" </style>\n"));
+ if (!buffer_string_is_empty(con->uri.query) && 0 == memcmp(con->uri.query->ptr, CONST_STR_LEN("refresh="))) {
+ /* Note: Refresh is an historical, but non-standard HTTP header
+ * References (meta http-equiv="refresh" use is deprecated):
+ * https://www.w3.org/TR/WCAG10-HTML-TECHS/#meta-element
+ * https://www.w3.org/TR/WCAG10-CORE-TECHS/#auto-page-refresh
+ * https://www.w3.org/QA/Tips/reback
+ */
+ const long refresh = strtol(con->uri.query->ptr+sizeof("refresh=")-1, NULL, 10);
+ if (refresh > 0) {
+ buffer_append_string_len(b, CONST_STR_LEN("<meta http-equiv=\"refresh\" content=\""));
+ buffer_append_int(b, refresh < 604800 ? refresh : 604800);
+ buffer_append_string_len(b, CONST_STR_LEN("\">\n"));
+ }
+ }
+
if (p->conf.sort) {
buffer_append_string_len(b, CONST_STR_LEN(
"<script type=\"text/javascript\">\n"