commit 7eb80e9
default
·
2023-06-18 17:34:35 +0000 UTC
parent 0a6a3a0
Renamed the HTTP Basic auth realm to something more informative.
1 files changed,
+4,
-2
M
httpd.c
M
httpd.c
+4,
-2
1@@ -250,8 +250,10 @@ void httpd_connection(FILE *f)
2 if (status == 303)
3 headers = xs_dict_append(headers, "location", body);
4
5- if (status == 401)
6- headers = xs_dict_append(headers, "WWW-Authenticate", "Basic realm=\"IDENTIFY\"");
7+ if (status == 401) {
8+ xs *www_auth = xs_fmt("Basic realm=\"%s snac login", xs_dict_get(srv_config, "host"));
9+ headers = xs_dict_append(headers, "WWW-Authenticate", www_auth);
10+ }
11
12 if (ctype == NULL)
13 ctype = "text/html; charset=utf-8";