if (!user) {
response.SetStatus(401, "Unauthorized");
+ response.AddHeader("Content-Type", "text/html");
response.AddHeader("WWW-Authenticate", "Basic realm=\"Icinga 2\"");
String msg = "<h1>Unauthorized</h1>";
response.WriteBody(msg.CStr(), msg.GetLength());
if (!handler || (!exact_match && !handler->CanAlsoHandleUrl(request.RequestUrl))) {
response.SetStatus(404, "Not found");
+ response.AddHeader("Content-Type", "text/html");
String msg = "<h1>Not found</h1>";
response.WriteBody(msg.CStr(), msg.GetLength());
response.Finish();