BaseCommonLinkUtility optimization

This commit is contained in:
pavelbannov 2019-09-20 12:30:27 +03:00
parent e13049c21f
commit 0e10323e30

View File

@ -90,10 +90,12 @@ namespace ASC.Core.Common
public CoreBaseSettings CoreBaseSettings { get; } public CoreBaseSettings CoreBaseSettings { get; }
public TenantManager TenantManager { get; } public TenantManager TenantManager { get; }
private string serverRootPath;
public string ServerRootPath public string ServerRootPath
{ {
get get
{ {
if (!string.IsNullOrEmpty(serverRootPath)) return serverRootPath;
UriBuilder result; UriBuilder result;
// first, take from current request // first, take from current request
if (HttpContext?.Request != null) if (HttpContext?.Request != null)
@ -137,7 +139,7 @@ namespace ASC.Core.Common
} }
} }
return result.Uri.ToString().TrimEnd('/'); return serverRootPath = result.Uri.ToString().TrimEnd('/');
} }
} }