Skip to content

Commit 0562757

Browse files
authored
Replace paths, so they are equal on every OS (#18071)
* Replace paths, so they are equal on every OS * Don't use Path.Combine
1 parent da07a24 commit 0562757

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Umbraco.Cms.Api.Management/Controllers/Security/BackOfficeGraphicsController.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using Microsoft.AspNetCore.Http;
66
using Microsoft.AspNetCore.Mvc;
77
using Microsoft.AspNetCore.StaticFiles;
8+
using Microsoft.Extensions.FileProviders;
89
using Microsoft.Extensions.Options;
910
using Umbraco.Cms.Api.Management.Routing;
1011
using Umbraco.Cms.Core;
@@ -55,8 +56,8 @@ public BackOfficeGraphicsController(IOptions<ContentSettings> contentSettings, I
5556

5657
private IActionResult HandleFileRequest(string virtualPath)
5758
{
58-
var filePath = Path.Combine(Constants.SystemDirectories.Umbraco, virtualPath).TrimStart(Constants.CharArrays.Tilde);
59-
var fileInfo = _webHostEnvironment.WebRootFileProvider.GetFileInfo(filePath);
59+
var filePath = $"{Constants.SystemDirectories.Umbraco}/{virtualPath}".TrimStart(Constants.CharArrays.Tilde);
60+
IFileInfo fileInfo = _webHostEnvironment.WebRootFileProvider.GetFileInfo(filePath);
6061

6162
if (fileInfo.PhysicalPath is null)
6263
{

0 commit comments

Comments
 (0)