From 99b4afb859899b18f39b95a01305ec71cbac76eb Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 5 Sep 2018 11:44:19 +0300 Subject: ActivityStreams: fix outbox links --- .../src/main/java/com/juick/server/api/activity/Profile.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'juick-server/src/main/java/com/juick/server/api') diff --git a/juick-server/src/main/java/com/juick/server/api/activity/Profile.java b/juick-server/src/main/java/com/juick/server/api/activity/Profile.java index d19b1c9c..772b1bee 100644 --- a/juick-server/src/main/java/com/juick/server/api/activity/Profile.java +++ b/juick-server/src/main/java/com/juick/server/api/activity/Profile.java @@ -60,7 +60,7 @@ public class Profile { User visitor = UserUtils.getCurrentUser(); User user = userService.getUserByName(userName); if (!user.isAnonymous()) { - ServletUriComponentsBuilder uriComponentsBuilder = ServletUriComponentsBuilder.fromCurrentRequestUri(); + UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromUriString(baseUri); OrderedCollection blog = new OrderedCollection(); blog.setId(uriComponentsBuilder.toUriString()); blog.setTotalItems(userService.getStatsMessages(user.getUid())); @@ -78,7 +78,8 @@ public class Profile { User visitor = UserUtils.getCurrentUser(); User user = userService.getUserByName(userName); if (!user.isAnonymous()) { - ServletUriComponentsBuilder uriComponentsBuilder = ServletUriComponentsBuilder.fromCurrentRequestUri(); + UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromUriString(baseUri); + uriComponentsBuilder.path(String.format("/u/%s/blog", userName)); List mids = messagesService.getUserBlog(user.getUid(), 0, before); List notes = messagesService.getMessages(visitor, mids).stream().map(m -> { Note note = new Note(); @@ -102,8 +103,6 @@ public class Profile { next.setHref(uriComponentsBuilder.queryParam("before", beforeNext).toUriString()); page.setNext(next); } - - page.setId(uriComponentsBuilder.toUriString()); return page; } throw new HttpNotFoundException(); -- cgit v1.2.3