diff options
author | Vitaly Takmazov | 2018-09-07 13:18:56 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-09-07 11:36:32 +0000 |
commit | f5b5b9edea2ce4ba7c01075f38592bebbfc8db3f (patch) | |
tree | 423c76c07999757f99231c5b1214291510e13116 /juick-server/src/main/java/com/juick/server/www/controllers | |
parent | 2ac7d0da0b044c0a14cc73adbd82ecc4014246c4 (diff) |
fix remaining errors, now live
Diffstat (limited to 'juick-server/src/main/java/com/juick/server/www/controllers')
-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, |