From 0e10323e3052fe9705bcaa9954272bf2b142f015 Mon Sep 17 00:00:00 2001 From: pavelbannov Date: Fri, 20 Sep 2019 12:30:27 +0300 Subject: [PATCH] BaseCommonLinkUtility optimization --- common/ASC.Core.Common/BaseCommonLinkUtility.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/ASC.Core.Common/BaseCommonLinkUtility.cs b/common/ASC.Core.Common/BaseCommonLinkUtility.cs index 5b8098ce0e..fba5f1a7c7 100644 --- a/common/ASC.Core.Common/BaseCommonLinkUtility.cs +++ b/common/ASC.Core.Common/BaseCommonLinkUtility.cs @@ -90,10 +90,12 @@ namespace ASC.Core.Common public CoreBaseSettings CoreBaseSettings { get; } public TenantManager TenantManager { get; } + private string serverRootPath; public string ServerRootPath { get { + if (!string.IsNullOrEmpty(serverRootPath)) return serverRootPath; UriBuilder result; // first, take from current request if (HttpContext?.Request != null) @@ -137,7 +139,7 @@ namespace ASC.Core.Common } } - return result.Uri.ToString().TrimEnd('/'); + return serverRootPath = result.Uri.ToString().TrimEnd('/'); } }