private ResponsePacket FileLoader(string path, string ext, ExtensionInfo extInfo) { ResponsePacket ret; try { var text = File.ReadAllText(WebsitePath + extInfo.FilePath + Path.GetFileName(path)); ret = new ResponsePacket() { Data = Encoding.UTF8.GetBytes(text), ContentType = extInfo.ContentType, Encoding = Encoding.UTF8 }; } catch (Exception ex) { Logger.Error(ex, $"Error in file loader: {ex.Message}"); ret = new ResponsePacket() { ResponseCode = HttpStatusCode.NotFound }; } return(ret); }