summaryrefslogtreecommitdiff
path: root/httpd.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-06-24 08:29:29 +0200
committerdefault <nobody@localhost>2023-06-24 08:29:29 +0200
commit2f3ed55790f5d929a47c9ec956f6bd61a95003f0 (patch)
tree564cc92b147c43d020ea49373d6c21e50044fd5c /httpd.c
parent3da32bd327642659b6ea96c29a5a581bdfc52ff9 (diff)
The WWW-Authenticate real also includes the user.
Diffstat (limited to 'httpd.c')
-rw-r--r--httpd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/httpd.c b/httpd.c
index 5409b85..de70089 100644
--- a/httpd.c
+++ b/httpd.c
@@ -251,7 +251,9 @@ void httpd_connection(FILE *f)
headers = xs_dict_append(headers, "location", body);
if (status == 401) {
- xs *www_auth = xs_fmt("Basic realm=\"%s snac login\"", xs_dict_get(srv_config, "host"));
+ xs *www_auth = xs_fmt("Basic realm=\"@%s@%s snac login\"",
+ body, xs_dict_get(srv_config, "host"));
+
headers = xs_dict_append(headers, "WWW-Authenticate", www_auth);
}