1
0
mirror of https://git.teknik.io/Teknikode/Teknik.git synced 2023-08-02 14:16:22 +02:00

Fixed shortener not using correct url when generated.

This commit is contained in:
Uncled1023 2016-02-24 16:06:27 -08:00
parent 62eed2bc16
commit 0aab15f446
3 changed files with 3 additions and 2 deletions

View File

@ -81,6 +81,7 @@ namespace Teknik
// Check if this route is valid for the current subdomain ('*' means any subdomain is valid)
if (Subdomains.Contains("*") || Subdomains.Contains(subdomain))
{
routeData.Values["sub"] = subdomain;
return routeData;
}
}

View File

@ -162,7 +162,7 @@ namespace Teknik.Areas.API.Controllers
db.ShortenedUrls.Add(newUrl);
db.SaveChanges();
string shortUrl = Url.SubRouteUrl(string.Empty, "Shortener.View", new { url = newUrl.ShortUrl });
string shortUrl = string.Format("http://{0}/{1}", Config.ShortenerConfig.ShortenerHost, newUrl.ShortUrl);
if (Config.DevEnvironment)
{
shortUrl = Url.SubRouteUrl("shortened", "Shortener.View", new { url = newUrl.ShortUrl });

View File

@ -56,7 +56,7 @@ namespace Teknik.Areas.Shortener.Controllers
db.ShortenedUrls.Add(newUrl);
db.SaveChanges();
string shortUrl = Url.SubRouteUrl(string.Empty, "Shortener.View", new { url = newUrl.ShortUrl });
string shortUrl = string.Format("http://{0}/{1}", Config.ShortenerConfig.ShortenerHost, newUrl.ShortUrl);
if (Config.DevEnvironment)
{
shortUrl = Url.SubRouteUrl("shortened", "Shortener.View", new { url = newUrl.ShortUrl });