summaryrefslogtreecommitdiff
path: root/httpd.c
diff options
context:
space:
mode:
authorGravatar default2023-06-18 19:34:35 +0200
committerGravatar default2023-06-18 19:34:35 +0200
commit7eb80e9916e0dde1987c35b528beca91e8a8f24c (patch)
tree2b720115af73ec5ed8801c54d41c2633945f5a91 /httpd.c
parentAvoid checking for deleted entries (starting with '-') in index_gc(). (diff)
downloadsnac2-7eb80e9916e0dde1987c35b528beca91e8a8f24c.tar.gz
snac2-7eb80e9916e0dde1987c35b528beca91e8a8f24c.tar.xz
snac2-7eb80e9916e0dde1987c35b528beca91e8a8f24c.zip
Renamed the HTTP Basic auth realm to something more informative.
Diffstat (limited to 'httpd.c')
-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)
250 if (status == 303) 250 if (status == 303)
251 headers = xs_dict_append(headers, "location", body); 251 headers = xs_dict_append(headers, "location", body);
252 252
253 if (status == 401) 253 if (status == 401) {
254 headers = xs_dict_append(headers, "WWW-Authenticate", "Basic realm=\"IDENTIFY\""); 254 xs *www_auth = xs_fmt("Basic realm=\"%s snac login", xs_dict_get(srv_config, "host"));
255 headers = xs_dict_append(headers, "WWW-Authenticate", www_auth);
256 }
255 257
256 if (ctype == NULL) 258 if (ctype == NULL)
257 ctype = "text/html; charset=utf-8"; 259 ctype = "text/html; charset=utf-8";