Created
April 16, 2015 15:29
-
-
Save dori4n/67f7bc54d2becb805e76 to your computer and use it in GitHub Desktop.
IsTldMatch Uri extension method, nothing special, really.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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