From 959effbbad1f8bbf3f90879212732a2e42011b22 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 21 May 2018 16:30:41 +0300 Subject: permanent redirect for /DDDDDD links --- juick-www/src/main/java/com/juick/www/controllers/AnythingFilter.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'juick-www/src/main/java') diff --git a/juick-www/src/main/java/com/juick/www/controllers/AnythingFilter.java b/juick-www/src/main/java/com/juick/www/controllers/AnythingFilter.java index 52e748f0..2e6da6c3 100644 --- a/juick-www/src/main/java/com/juick/www/controllers/AnythingFilter.java +++ b/juick-www/src/main/java/com/juick/www/controllers/AnythingFilter.java @@ -39,7 +39,9 @@ public class AnythingFilter implements Filter { com.juick.User author = messagesService.getMessageAuthor(messageId); if (author != null) { - ((HttpServletResponse)servletResponse).sendRedirect("/" + author.getName() + "/" + anything); + HttpServletResponse response = ((HttpServletResponse)servletResponse); + response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY); + response.setHeader("Location", "/" + author.getName() + "/" + anything); return; } } -- cgit v1.2.3