diff options
Diffstat (limited to 'juick-server/src/main/java/com/juick/server/api')
-rw-r--r-- | juick-server/src/main/java/com/juick/server/api/activity/Profile.java | 7 |
1 files changed, 3 insertions, 4 deletions
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 d19b1c9ce..772b1beeb 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<Integer> mids = messagesService.getUserBlog(user.getUid(), 0, before); List<Note> 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(); |