diff options
Diffstat (limited to 'juick-www/src/main/java/com/juick/www/Main.java')
-rw-r--r-- | juick-www/src/main/java/com/juick/www/Main.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/juick-www/src/main/java/com/juick/www/Main.java b/juick-www/src/main/java/com/juick/www/Main.java index 27ecf3ec..077a3e32 100644 --- a/juick-www/src/main/java/com/juick/www/Main.java +++ b/juick-www/src/main/java/com/juick/www/Main.java @@ -22,6 +22,7 @@ import com.juick.server.UserQueries; import com.mitchellbosecke.pebble.error.PebbleException; import org.apache.commons.dbcp2.BasicDataSource; import org.apache.commons.lang3.BooleanUtils; +import org.apache.commons.lang3.CharEncoding; import org.apache.commons.lang3.math.NumberUtils; import org.springframework.jdbc.core.JdbcTemplate; import rocks.xmpp.addr.Jid; @@ -147,14 +148,14 @@ public class Main extends HttpServlet { @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (request.getCharacterEncoding() == null) { - request.setCharacterEncoding("UTF-8"); + request.setCharacterEncoding(CharEncoding.UTF_8); } String uri = request.getRequestURI(); if (uri.equals("/")) { String tag = request.getParameter("tag"); if (tag != null) { - Utils.sendPermanentRedirect(response, "/tag/" + URLEncoder.encode(tag, "UTF-8")); + Utils.sendPermanentRedirect(response, "/tag/" + URLEncoder.encode(tag, CharEncoding.UTF_8)); } else { com.juick.User visitor = Utils.getVisitorUser(sql, request, response); home.doGet(sql, sqlSearch, request, response, visitor); @@ -323,7 +324,7 @@ public class Main extends HttpServlet { @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (request.getCharacterEncoding() == null) { - request.setCharacterEncoding("UTF-8"); + request.setCharacterEncoding(CharEncoding.UTF_8); } String uri = request.getRequestURI(); |