AssetPackager.Helpers.UrlHelper.ResolveAbsoluteUrl C# (CSharp) Method

ResolveAbsoluteUrl() private method

private ResolveAbsoluteUrl ( string relativePath ) : string
relativePath string
return string
		public static string ResolveAbsoluteUrl(string relativePath)
		{
			if (relativePath[0] != '~') return relativePath;

			string appPath = HttpContext.Current.Request.ApplicationPath == "/"
			                 	? "/"
			                 	: HttpContext.Current.Request.ApplicationPath + "/";
			return HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) + appPath + relativePath.Substring(2);
		}
	}