Browse Source

Fixed shortener not using correct url when generated.

tags/2.0.3
Teknikode 5 years ago
parent
commit
0aab15f446

+ 1
- 0
Teknik/App_Start/SubdomainRoute.cs 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;
}
}

+ 1
- 1
Teknik/Areas/API/Controllers/APIv1Controller.cs 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 });

+ 1
- 1
Teknik/Areas/Shortener/Controllers/ShortenerController.cs 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 });

Loading…
Cancel
Save