mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 23:31:13 -05:00
fixed misc issues and added stats page to webfront
This commit is contained in:
@ -50,21 +50,27 @@ namespace IW4MAdmin
|
||||
{
|
||||
SharedLibrary.HttpResponse requestedPage = WebService.GetPage(request.Path, querySet, request.Headers);
|
||||
|
||||
bool binaryContent = requestedPage.BinaryContent != null;
|
||||
if (requestedPage.content != null && requestedPage.content.GetType() != typeof(string))
|
||||
requestedPage.content = Newtonsoft.Json.JsonConvert.SerializeObject(requestedPage.content);
|
||||
|
||||
var headers = new HttpResponseHead()
|
||||
{
|
||||
Status = "200 OK",
|
||||
Headers = new Dictionary<string, string>()
|
||||
{
|
||||
{ "Content-Type", requestedPage.contentType },
|
||||
{ "Content-Length", requestedPage.content.Length.ToString() },
|
||||
{ "Content-Length", binaryContent ? requestedPage.BinaryContent.Length.ToString() : requestedPage.content.ToString().Length.ToString() },
|
||||
{ "Access-Control-Allow-Origin", "*" },
|
||||
}
|
||||
};
|
||||
|
||||
foreach (var key in requestedPage.additionalHeaders.Keys)
|
||||
headers.Headers.Add(key, requestedPage.additionalHeaders[key]);
|
||||
|
||||
response.OnResponse(headers, new BufferedProducer(requestedPage.content));
|
||||
if (!binaryContent)
|
||||
response.OnResponse(headers, new BufferedProducer((string)requestedPage.content));
|
||||
else
|
||||
response.OnResponse(headers, new BufferedProducer(requestedPage.BinaryContent));
|
||||
}
|
||||
|
||||
catch (Exception e)
|
||||
|
Reference in New Issue
Block a user