Skip to content

Commit 989691b

Browse files
Use remaining path segment
1 parent 7bb3849 commit 989691b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Umbraco.StorageProviders.AzureBlob/AzureBlobFileSystemMiddleware.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@ private async Task HandleRequestAsync(HttpContext context, RequestDelegate next)
8383
var request = context.Request;
8484
var response = context.Response;
8585

86-
if (!context.Request.Path.StartsWithSegments(_rootPath, StringComparison.InvariantCultureIgnoreCase))
86+
if (!context.Request.Path.StartsWithSegments(_rootPath, StringComparison.InvariantCultureIgnoreCase, out PathString path))
8787
{
8888
await next(context).ConfigureAwait(false);
8989
return;
9090
}
9191

92-
string containerPath = $"{_containerRootPath.TrimEnd('/')}/{(request.Path.Value.Remove(0, _rootPath.Length)).TrimStart('/')}";
92+
string containerPath = $"{_containerRootPath.TrimEnd('/')}/{path.Value?.TrimStart('/')}";
9393
var blob = _fileSystemProvider.GetFileSystem(_name).GetBlobClient(containerPath);
9494

9595
var blobRequestConditions = GetAccessCondition(context.Request);

0 commit comments

Comments
 (0)