diff --git a/src/BirdsiteLive/Controllers/UsersController.cs b/src/BirdsiteLive/Controllers/UsersController.cs index dd1b081..893e0c5 100644 --- a/src/BirdsiteLive/Controllers/UsersController.cs +++ b/src/BirdsiteLive/Controllers/UsersController.cs @@ -36,21 +36,31 @@ namespace BirdsiteLive.Controllers } #endregion + [Route("/users")] + public IActionResult Index() + { + var r = Request.Headers["Accept"].First(); + if (r.Contains("application/activity+json")) return NotFound(); + return View("UserNotFound"); + } + [Route("/@{id}")] [Route("/users/{id}")] public IActionResult Index(string id) { var user = _twitterService.GetUser(id); - if (user == null) return NotFound(); var r = Request.Headers["Accept"].First(); if (r.Contains("application/activity+json")) { + if (user == null) return NotFound(); var apUser = _userService.GetUser(user); var jsonApUser = JsonConvert.SerializeObject(apUser); return Content(jsonApUser, "application/activity+json; charset=utf-8"); } + if (user == null) return View("UserNotFound"); + var displayableUser = new DisplayTwitterUser { Name = user.Name, diff --git a/src/BirdsiteLive/Views/Users/UserNotFound.cshtml b/src/BirdsiteLive/Views/Users/UserNotFound.cshtml new file mode 100644 index 0000000..ec0928f --- /dev/null +++ b/src/BirdsiteLive/Views/Users/UserNotFound.cshtml @@ -0,0 +1,11 @@ +@{ + ViewData["Title"] = "User"; +} + +
+

User not found

+ + + Back + +
\ No newline at end of file