diff options
author | Vitaly Takmazov | 2023-01-19 21:57:50 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-19 21:57:50 +0300 |
commit | eb665ea6edc2aaff9f9a562c875b38b4878e2709 (patch) | |
tree | 2df0b1112ebb664e9d906834f3e3d61fb8d8d890 /src/main | |
parent | 1e82cb7125e4aa81dcbafa4746af1f0f9651b8c1 (diff) |
ActivityPub: blog redirect
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/com/juick/www/controllers/Site.java | 8 |
1 files changed, 6 insertions, 2 deletions
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, |