commit 2e9e2eb

default  ·  2024-06-09 15:04:34 +0000 UTC
parent c648fab
Don't return a Basic realm if there is no body.
1 files changed,  +1, -1
+1, -1
1@@ -406,7 +406,7 @@ void httpd_connection(FILE *f)
2     if (status == HTTP_STATUS_SEE_OTHER)
3         headers = xs_dict_append(headers, "location", body);
4 
5-    if (status == HTTP_STATUS_UNAUTHORIZED) {
6+    if (status == HTTP_STATUS_UNAUTHORIZED && body) {
7         xs *www_auth = xs_fmt("Basic realm=\"@%s@%s snac login\"",
8                                 body, xs_dict_get(srv_config, "host"));
9