summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-06-18 19:34:35 +0200
committerdefault <nobody@localhost>2023-06-18 19:34:35 +0200
commit7eb80e9916e0dde1987c35b528beca91e8a8f24c (patch)
tree2b720115af73ec5ed8801c54d41c2633945f5a91
parent0a6a3a0a9a11f65fde3d171d4b615d6e207d5420 (diff)
Renamed the HTTP Basic auth realm to something more informative.
-rw-r--r--httpd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/httpd.c b/httpd.c
index 4272199..fe885d7 100644
--- a/httpd.c
+++ b/httpd.c
@@ -250,8 +250,10 @@ void httpd_connection(FILE *f)
if (status == 303)
headers = xs_dict_append(headers, "location", body);
- if (status == 401)
- headers = xs_dict_append(headers, "WWW-Authenticate", "Basic realm=\"IDENTIFY\"");
+ if (status == 401) {
+ xs *www_auth = xs_fmt("Basic realm=\"%s snac login", xs_dict_get(srv_config, "host"));
+ headers = xs_dict_append(headers, "WWW-Authenticate", www_auth);
+ }
if (ctype == NULL)
ctype = "text/html; charset=utf-8";