Huge IIOHelper cleanup, removes some overlap with IHostingEnvironment, much less usages of IIOHelper and instead just use what is already available on IHostingEnvironment

This commit is contained in:
Shannon
2020-04-03 11:03:06 +11:00
parent 1224c97f07
commit 7e2d0902af
70 changed files with 436 additions and 415 deletions

View File

@@ -91,13 +91,11 @@ namespace Umbraco.Web.Common.AspNetCore
if (!virtualPath.StartsWith("~/") && !virtualPath.StartsWith("/"))
throw new InvalidOperationException($"{nameof(virtualPath)} must start with ~/ or /");
var root = ApplicationVirtualPath.EnsureStartsWith('/');
// will occur if it starts with "/"
if (Uri.IsWellFormedUriString(virtualPath, UriKind.Absolute))
return virtualPath;
var fullPath = root.EnsureEndsWith('/') + virtualPath.TrimStart("~/");
var fullPath = ApplicationVirtualPath.EnsureEndsWith('/') + virtualPath.TrimStart("~/");
return fullPath;
}