summary refs log tree commit diff
path: root/GitRepoViewer/WebRepoSource.cs
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-04-30 21:51:29 +0200
committerRory& <root@rory.gay>2026-04-30 21:51:29 +0200
commit35750c674408d01344fb2c65a5e8b3170f7e9921 (patch)
treeb2e6576a3f30ada96032aa10472db5d73683a30f /GitRepoViewer/WebRepoSource.cs
parentUse bulk reads and more intrinsics (diff)
downloadGitTools-35750c674408d01344fb2c65a5e8b3170f7e9921.tar.xz
Implement FileExists in WebRepoSource HEAD master
Diffstat (limited to 'GitRepoViewer/WebRepoSource.cs')
-rw-r--r--GitRepoViewer/WebRepoSource.cs9
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 +}