From eb665ea6edc2aaff9f9a562c875b38b4878e2709 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 19 Jan 2023 21:57:50 +0300 Subject: ActivityPub: blog redirect --- src/main/java/com/juick/www/controllers/Site.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/com/juick/www/controllers/Site.java b/src/main/java/com/juick/www/controllers/Site.java index f4f8f744..06513fcc 100644 --- a/src/main/java/com/juick/www/controllers/Site.java +++ b/src/main/java/com/juick/www/controllers/Site.java @@ -217,8 +217,12 @@ public class Site { } return "views/index"; } - - @GetMapping(path = "/{uname}/", headers = "Connection!=Upgrade") + @GetMapping(value = "/{uname}/", produces = { MediaType.APPLICATION_JSON_VALUE, Context.LD_JSON_MEDIA_TYPE, Context.ACTIVITY_MEDIA_TYPE, + Context.ACTIVITYSTREAMS_PROFILE_MEDIA_TYPE }) + public RedirectView blogRedirect(@PathVariable String uname) { + return new RedirectView("/u/" + uname); + } + @GetMapping(value = "/{uname}/", produces = { MediaType.TEXT_HTML_VALUE, MediaType.ALL_VALUE }) protected String doGetBlog(@Parameter(hidden = true) User visitor, @RequestParam(required = false, name = "show") String paramShow, @RequestParam(required = false, name = "tag") String paramTagStr, @RequestParam(required = false, name = "search") String paramSearch, -- cgit v1.2.3