diff --git a/BuildFeed/Controllers/frontController.cs b/BuildFeed/Controllers/frontController.cs index cb1d116..cdb9772 100644 --- a/BuildFeed/Controllers/frontController.cs +++ b/BuildFeed/Controllers/frontController.cs @@ -78,6 +78,7 @@ public async Task viewGroup(byte major, byte minor, ushort number, public async Task viewBuild(Guid id) { BuildModel b = await bModel.SelectById(id); + if (b == null) return new HttpNotFoundResult(); return View(b); } @@ -85,17 +86,19 @@ public async Task viewBuild(Guid id) public async Task viewBuild(long id) { BuildModel b = await bModel.SelectByLegacyId(id); + if (b == null) return new HttpNotFoundResult(); return RedirectToAction("viewBuild", new { id = b.Id }); } - [Route("twitter/{id}/")] + [Route("twitter/{id:guid}/", Name = "Twitter")] #if !DEBUG -// [OutputCache(Duration = 600, VaryByParam = "none")] +// [OutputCache(Duration = 600, VaryByParam = "none")] [CustomContentType(ContentType = "image/png", Order = 2)] #endif public async Task twitterCard(Guid id) { BuildModel b = await bModel.SelectById(id); + if (b == null) return new HttpNotFoundResult(); using (Bitmap bm = new Bitmap(560, 300)) { @@ -124,6 +127,14 @@ public async Task twitterCard(Guid id) return new EmptyResult(); } + [Route("twitter/{id:long}/", Name = "Twitter (Legacy)")] + public async Task twitterCard(long id) + { + BuildModel b = await bModel.SelectByLegacyId(id); + if (b == null) return new HttpNotFoundResult(); + return RedirectToAction("twitterCard", new { id = b.Id }); + } + [Route("lab/{lab}/", Order = 1, Name = "Lab Root")] #if !DEBUG // [OutputCache(Duration = 600, VaryByParam = "none", VaryByCustom = "userName")] diff --git a/BuildFeed/Views/shared/error.cshtml b/BuildFeed/Views/shared/error.cshtml index e68acf0..533d4a9 100644 --- a/BuildFeed/Views/shared/error.cshtml +++ b/BuildFeed/Views/shared/error.cshtml @@ -1,5 +1,6 @@ @model System.Web.Mvc.HandleErrorInfo @{ + Layout = null; bool IsRTL = System.Globalization.CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft; } diff --git a/BuildFeed/Web.config b/BuildFeed/Web.config index 0289da2..2242a87 100644 --- a/BuildFeed/Web.config +++ b/BuildFeed/Web.config @@ -70,6 +70,9 @@ + + +