Skip to content

Instantly share code, notes, and snippets.

@dori4n
Created April 16, 2015 15:29
Show Gist options
  • Save dori4n/67f7bc54d2becb805e76 to your computer and use it in GitHub Desktop.
Save dori4n/67f7bc54d2becb805e76 to your computer and use it in GitHub Desktop.
IsTldMatch Uri extension method, nothing special, really.
using System;
using System.Web;
namespace Application
{
public static class Extensions
{
public static bool IsTldMatch(this Uri Url, string Tld)
{
if (HttpRequest.Url.Host == Tld || HttpRequest.Url.Host.EndsWith(string.Concat(".", Tld)) // could just as well return the result of this...
{
return true;
}
else
{
return false;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment