Exemple #1
0
        public string NormalizeUrl(string url)
        {
            Uri uri            = new Uri(url);
            var host           = uri.Host;
            var normalizedHost = emailFormatter.PunycodeToUnicode(emailFormatter.UnicodeToPunycode(host));

            var uriBuilder = new UriBuilder(url);

            uriBuilder.Host = normalizedHost;
            return(uriBuilder.Uri.ToString());
        }
Exemple #2
0
        public ActionResult <string> PunycodeToUnicode([FromServices] IEmailFormatter emailFormatter, string domain)
        {
            var result = emailFormatter.PunycodeToUnicode(domain);

            return(result);
        }