1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-11-23 01:49:53 +03:00

Cedar: serve new web management interface

This commit is contained in:
dnobori 2019-11-21 23:57:57 +01:00 committed by Davide Beatrici
parent 9aaa9a7f15
commit 82a81a3ce6

View File

@ -5774,14 +5774,31 @@ bool ServerDownloadSignature(CONNECTION *c, char **error_detail_str)
} }
else else
{ {
if (StrCmpi(h->Target, "/") == 0) if (StrCmpi(h->Target, "/") == 0)
{ {
// Root directory // Root directory
BUF *b = NULL;
*error_detail_str = "HTTP_ROOT"; *error_detail_str = "HTTP_ROOT";
if (server->DisableJsonRpcWebApi == false)
{
b = ReadDump("|wwwroot\\index.html");
}
if (b != NULL)
{
FreeHttpHeader(h);
h = NewHttpHeader("HTTP/1.1", "202", "OK");
AddHttpValue(h, NewHttpValue("Content-Type", HTTP_CONTENT_TYPE4));
AddHttpValue(h, NewHttpValue("Connection", "Keep-Alive"));
AddHttpValue(h, NewHttpValue("Keep-Alive", HTTP_KEEP_ALIVE));
PostHttp(c->FirstSock, h, b->Buf, b->Size);
FreeBuf(b);
}
else
{ {
// Other than free version
HttpSendForbidden(c->FirstSock, h->Target, ""); HttpSendForbidden(c->FirstSock, h->Target, "");
} }
} }