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:
parent
62eed2bc16
commit
0aab15f446
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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 });
|
||||
|
@ -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…
Reference in New Issue
Block a user