From 82a81a3ce68be5a0a6bcb8f9409c0decc782f89c Mon Sep 17 00:00:00 2001 From: dnobori Date: Thu, 21 Nov 2019 23:57:57 +0100 Subject: [PATCH] Cedar: serve new web management interface --- src/Cedar/Protocol.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/Cedar/Protocol.c b/src/Cedar/Protocol.c index 45a0b064..8e7be7e7 100644 --- a/src/Cedar/Protocol.c +++ b/src/Cedar/Protocol.c @@ -5774,14 +5774,31 @@ bool ServerDownloadSignature(CONNECTION *c, char **error_detail_str) } else { - if (StrCmpi(h->Target, "/") == 0) { // Root directory + BUF *b = NULL; *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, ""); } }