diff options
Diffstat (limited to 'juick-server/src/main/java/com/juick/server/www')
-rw-r--r-- | juick-server/src/main/java/com/juick/server/www/controllers/AnythingFilter.java | 4 | ||||
-rw-r--r-- | juick-server/src/main/java/com/juick/server/www/controllers/MessagesWWW.java | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/juick-server/src/main/java/com/juick/server/www/controllers/AnythingFilter.java b/juick-server/src/main/java/com/juick/server/www/controllers/AnythingFilter.java index 9ab20003..4bdbf298 100644 --- a/juick-server/src/main/java/com/juick/server/www/controllers/AnythingFilter.java +++ b/juick-server/src/main/java/com/juick/server/www/controllers/AnythingFilter.java @@ -27,6 +27,10 @@ public class AnythingFilter extends OncePerRequestFilter { public void doFilterInternal(@Nonnull HttpServletRequest servletRequest, @Nonnull HttpServletResponse servletResponse, @Nonnull FilterChain filterChain) throws IOException, ServletException { + String upgrade = servletRequest.getHeader("Connection"); + if (upgrade != null && upgrade.equals("Upgrade")) { + filterChain.doFilter(servletRequest, servletResponse); + } UriComponents components = ServletUriComponentsBuilder.fromCurrentRequestUri().build(); String anything = components.getPath().substring(1); int before = NumberUtils.toInt(components.getQueryParams().getFirst("before"), 0); diff --git a/juick-server/src/main/java/com/juick/server/www/controllers/MessagesWWW.java b/juick-server/src/main/java/com/juick/server/www/controllers/MessagesWWW.java index 10136fcf..de50849d 100644 --- a/juick-server/src/main/java/com/juick/server/www/controllers/MessagesWWW.java +++ b/juick-server/src/main/java/com/juick/server/www/controllers/MessagesWWW.java @@ -73,7 +73,7 @@ public class MessagesWWW { model.addAttribute("isSubscribed", userService.isSubscribed(visitor.getUid(), user.getUid())); model.addAttribute("isInBL", userService.isInBL(visitor.getUid(), user.getUid())); model.addAttribute("isInBLAny", userService.isInBLAny(user.getUid(), visitor.getUid())); - model.addAttribute("statsIRead", userService.getUserFriends(user.getUid())); + model.addAttribute("statsIRead", userService.getUserFriends(user.getUid()).size()); model.addAttribute("statsMyReaders", userService.getStatsMyReaders(user.getUid())); model.addAttribute("statsMyBL", userService.getUserBLUsers(user.getUid()).size()); model.addAttribute("statsMessages", userService.getStatsMessages(user.getUid())); @@ -192,7 +192,7 @@ public class MessagesWWW { return "views/index"; } - @GetMapping("/{uname}/") + @GetMapping(path = "/{uname}/", headers = "Connection!=Upgrade") protected String doGetBlog( @RequestParam(required = false, name = "show") String paramShow, @RequestParam(required = false, name = "tag") String paramTagStr, |