mirror of
https://github.com/Icinga/icinga2.git
synced 2026-04-15 22:00:07 -04:00
parent
8dedd47b89
commit
ceea8a24d3
2 changed files with 2 additions and 0 deletions
|
|
@ -149,6 +149,7 @@ void HttpConnection::ProcessMessageAsync(HttpRequest& request)
|
|||
|
||||
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());
|
||||
|
|
|
|||
|
|
@ -88,6 +88,7 @@ void HttpHandler::ProcessRequest(const ApiUser::Ptr& user, HttpRequest& request,
|
|||
|
||||
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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue