internal static async Task ManageRequest(IWebResponse response) { response.SetEncoding("UTF-8"); string path = GetQueryPath(response.GetRequestedPath()); var content = GetResourceStream(path); //Manage Index content if (path == Constants.DefaultPage) { content = ManageIndexPageRendering(content); } response.AddResponseHeader("Cache-Control", "no-cache"); response.AddResponseHeader("Access-Control-Allow-Origin", GetBaseURL()); if (content == null) { //Content not found response.SetStatutCode(404); response.SetReasonPhrase("Not found"); response.SetMimeType("text/plain"); return; } response.SetStatutCode(200); response.SetReasonPhrase("OK"); response.SetMimeType(GetContentType(path)); await response.SetDataAsync(content); }