diff --git a/Common.csproj b/Common.csproj index fccd0ff..a8bb9dc 100644 --- a/Common.csproj +++ b/Common.csproj @@ -146,6 +146,7 @@ + True diff --git a/Internet/UrlHelper.cs b/Internet/UrlHelper.cs new file mode 100644 index 0000000..0aeaa46 --- /dev/null +++ b/Internet/UrlHelper.cs @@ -0,0 +1,15 @@ +using System; + +namespace Common.Internet +{ + public static class UrlHelper + { + public static string GetAbsoluteUrlString(string baseUrl, string url) + { + var uri = new Uri(url, UriKind.RelativeOrAbsolute); + if (!uri.IsAbsoluteUri) + uri = new Uri(new Uri(baseUrl), uri); + return uri.ToString(); + } + } +}