From 426fb0adf2fec1a4a8944d823771e61a13e566f3 Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Tue, 19 Nov 2024 12:27:31 -0800 Subject: [PATCH] Use enescaped string when calling Azure BlobClient --- src/SourceBrowser/src/SourceIndexServer/Helpers.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/SourceBrowser/src/SourceIndexServer/Helpers.cs b/src/SourceBrowser/src/SourceIndexServer/Helpers.cs index cd3cf85..eaa62d9 100644 --- a/src/SourceBrowser/src/SourceIndexServer/Helpers.cs +++ b/src/SourceBrowser/src/SourceIndexServer/Helpers.cs @@ -10,7 +10,7 @@ namespace Microsoft.SourceBrowser.SourceIndexServer { public static class Helpers { - public static async Task ProxyRequestAsync(this HttpContext context, string targetPath, Action configureRequest = null) + private static async Task ProxyRequestAsync(this HttpContext context, string targetPath, Action configureRequest = null) { var fs = new AzureBlobFileSystem(IndexProxyUrl); var props = fs.FileProperties(targetPath); @@ -24,7 +24,7 @@ public static async Task ProxyRequestAsync(this HttpContext context, string targ } } - private static bool UrlExists(string proxyRequestPath) + private static bool FileExists(string proxyRequestPath) { var fs = new AzureBlobFileSystem(IndexProxyUrl); return fs.FileExists(proxyRequestPath); @@ -32,7 +32,7 @@ private static bool UrlExists(string proxyRequestPath) public static async Task ServeProxiedIndex(HttpContext context, Func next) { - var path = context.Request.Path.ToUriComponent(); + var path = context.Request.Path.Value; if (!path.EndsWith(".html", StringComparison.Ordinal) && !path.EndsWith(".txt", StringComparison.Ordinal)) { @@ -49,7 +49,7 @@ public static async Task ServeProxiedIndex(HttpContext context, Func next) var proxyRequestPathSuffix = (path.StartsWith("/", StringComparison.Ordinal) ? path : "/" + path).ToLowerInvariant(); - if (!UrlExists(proxyRequestPathSuffix)) + if (!FileExists(proxyRequestPathSuffix)) { await next().ConfigureAwait(false); return;