1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 23:31:13 -05:00

-added !ip command (prints a client's external IP)

-fixed up the findall command
-moved aliases to the manager
-added admins page to view privileged users
-fixed refactoring mistake with messages
This commit is contained in:
RaidMax
2017-08-17 18:28:08 -05:00
parent 7c0ad5c021
commit 6a94882d20
15 changed files with 276 additions and 105 deletions

View File

@ -45,23 +45,41 @@ namespace IW4MAdmin
querySet = System.Web.HttpUtility.ParseQueryString(SharedLibrary.Utilities.StripIllegalCharacters(request.QueryString));
querySet.Set("IP", IP);
SharedLibrary.HttpResponse requestedPage = WebService.GetPage(request.Path, querySet, request.Headers);
var headers = new HttpResponseHead()
try
{
Status = "200 OK",
Headers = new Dictionary<string, string>()
SharedLibrary.HttpResponse requestedPage = WebService.GetPage(request.Path, querySet, request.Headers);
var headers = new HttpResponseHead()
{
Status = "200 OK",
Headers = new Dictionary<string, string>()
{
{ "Content-Type", requestedPage.contentType },
{ "Content-Length", requestedPage.content.Length.ToString() },
{ "Access-Control-Allow-Origin", "*" },
}
};
};
foreach (var key in requestedPage.additionalHeaders.Keys)
headers.Headers.Add(key, requestedPage.additionalHeaders[key]);
foreach (var key in requestedPage.additionalHeaders.Keys)
headers.Headers.Add(key, requestedPage.additionalHeaders[key]);
response.OnResponse(headers, new BufferedProducer(requestedPage.content));
response.OnResponse(headers, new BufferedProducer(requestedPage.content));
}
catch (Exception e)
{
ApplicationManager.GetInstance().Logger.WriteError($"Webfront error during request: {e.Message}");
response.OnResponse(new HttpResponseHead()
{
Status = "500 Internal Server Error",
Headers = new Dictionary<string, string>()
{
{ "Content-Type", "text/html" },
{ "Content-Length", "0"},
}
}, new BufferedProducer(""));
}
}
}