From 35750c674408d01344fb2c65a5e8b3170f7e9921 Mon Sep 17 00:00:00 2001 From: Rory& Date: Thu, 30 Apr 2026 21:51:29 +0200 Subject: Implement FileExists in WebRepoSource --- GitRepoViewer/WebRepoSource.cs | 9 +++++++-- 1 file 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 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 +} -- cgit 1.5.1