From 2f3ed55790f5d929a47c9ec956f6bd61a95003f0 Mon Sep 17 00:00:00 2001 From: default Date: Sat, 24 Jun 2023 08:29:29 +0200 Subject: The WWW-Authenticate real also includes the user. --- httpd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'httpd.c') 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); } -- cgit v1.2.3