Example #1
0
        public ActionResult <string> get(string subdomain)
        {
            if (containNumber(subdomain))
            {
                return(BadRequest());
            }
            string longUrl = shortener.searchForShortUrl(subdomain);

            if (!String.Equals(longUrl, null))
            {
                if (beginWithScheme(longUrl))
                {
                    return(Redirect(longUrl));
                }
                return(Redirect("https://" + longUrl));
            }
            return(NotFound());
        }