1
0

Added Basic auth support to cHTTPRequest.

This commit is contained in:
madmaxoft
2013-10-04 20:28:30 +02:00
parent 1012fd82fd
commit db3d83b38d
7 changed files with 136 additions and 1 deletions

View File

@@ -73,6 +73,16 @@ class cDebugCallbacks :
return;
}
// Test the auth failure and success:
if (a_Request.GetURL() == "/auth")
{
if (!a_Request.HasAuth() || (a_Request.GetAuthUsername() != "a") || (a_Request.GetAuthPassword() != "b"))
{
a_Connection.SendNeedAuth("MCServer WebAdmin");
return;
}
}
cHTTPResponse Resp;
Resp.SetContentType("text/plain");
a_Connection.Send(Resp);