Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/SourceBrowser/src/SourceIndexServer/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Microsoft.SourceBrowser.SourceIndexServer
{
public static class Helpers
{
public static async Task ProxyRequestAsync(this HttpContext context, string targetPath, Action<HttpRequestMessage> configureRequest = null)
private static async Task ProxyRequestAsync(this HttpContext context, string targetPath, Action<HttpRequestMessage> configureRequest = null)
{
var fs = new AzureBlobFileSystem(IndexProxyUrl);
var props = fs.FileProperties(targetPath);
Expand All @@ -24,15 +24,15 @@ 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);
}

public static async Task ServeProxiedIndex(HttpContext context, Func<Task> next)
{
var path = context.Request.Path.ToUriComponent();
var path = context.Request.Path.Value;

if (!path.EndsWith(".html", StringComparison.Ordinal) && !path.EndsWith(".txt", StringComparison.Ordinal))
{
Expand All @@ -49,7 +49,7 @@ public static async Task ServeProxiedIndex(HttpContext context, Func<Task> next)

var proxyRequestPathSuffix = (path.StartsWith("/", StringComparison.Ordinal) ? path : "/" + path).ToLowerInvariant();

if (!UrlExists(proxyRequestPathSuffix))
if (!FileExists(proxyRequestPathSuffix))
{
await next().ConfigureAwait(false);
return;
Expand Down
Loading