public IActionResult Status(String requestPath) { String reqPath = requestPath.Replace('/', Path.DirectorySeparatorChar); String realPath = Path.Combine(Configuration.Get.GalleryPath, reqPath); // The requested path must be a subdir of our configured gallery path, and it must exist if (realPath.Contains(Configuration.Get.GalleryPath) && Directory.Exists(realPath)) { using ProgressWorker progress = new ProgressWorker(new DirectoryInfo(realPath)); return(Ok(progress.GetProgress())); } return(NotFound()); }