1 files changed, 7 insertions, 2 deletions
diff --git a/GitRepoViewer/WebRepoSource.cs b/GitRepoViewer/WebRepoSource.cs
index d0770ec..7b18aaf 100644
--- a/GitRepoViewer/WebRepoSource.cs
+++ b/GitRepoViewer/WebRepoSource.cs
@@ -65,6 +65,11 @@ public class WebRepoSource : IRepoSource
return SessionStorage != null && await SessionStorage.ContainKeyAsync(_path);
}
-
+ public async Task<bool> FileExists(string path) {
+ using var hc = new HttpClient();
+ var _path = Path.Join(BasePath, path);
+ var resp = await hc.GetAsync(_path);
+ return resp.IsSuccessStatusCode;
+ }
private static readonly string[] noCachePathPrefixes = { "HEAD", "info", "refs" };
-}
\ No newline at end of file
+}
|