Ticket #463: 0003-Protect-the-status-page-with-authentication.patch
| File 0003-Protect-the-status-page-with-authentication.patch, 1.1 kB (added by wichert@wiggy.net, 8 months ago) |
|---|
-
a/src/http.c
old new 137 137 void 138 138 http_callback_status(httpd *webserver, request *r) 139 139 { 140 const s_config *config = config_get_config(); 140 141 char * status = NULL; 141 142 char *buf; 143 144 if (config->httpdusername && 145 (strcmp(config->httpdusername, r->request.authUser) || 146 strcmp(config->httpdpassword, r->request.authPassword))) { 147 debug(LOG_INFO, "Status page requested, forcing authentication"); 148 httpdForceAuthenticate(r, config->httpdrealm); 149 return; 150 } 151 142 152 status = get_status_text(); 143 153 safe_asprintf(&buf, "<pre>%s</pre>", status); 144 154 send_http_page(r, "WiFiDog Status", buf);
