aboutsummaryrefslogtreecommitdiff
path: root/juick-www/src/main/java/com/juick/www/Login.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-11-23 12:08:45 +0300
committerGravatar Vitaly Takmazov2016-11-23 12:08:45 +0300
commit42718787291bed507caf4f7ae13f6c41f9b8d7ff (patch)
tree2ba7bb057a6a740e98c5f4d6dae813af1a6b977f /juick-www/src/main/java/com/juick/www/Login.java
parentaa3c1a06ed46f49b617e2956b6cf9a1b0d367fb0 (diff)
using HttpServletResponse status codes
Diffstat (limited to 'juick-www/src/main/java/com/juick/www/Login.java')
-rw-r--r--juick-www/src/main/java/com/juick/www/Login.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/juick-www/src/main/java/com/juick/www/Login.java b/juick-www/src/main/java/com/juick/www/Login.java
index 19cc855b..27f34c1c 100644
--- a/juick-www/src/main/java/com/juick/www/Login.java
+++ b/juick-www/src/main/java/com/juick/www/Login.java
@@ -186,7 +186,7 @@ public class Login {
protected void doGetLogin(JdbcTemplate sql, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String hash = request.getQueryString();
if (hash.length() > 32) {
- response.sendError(400);
+ response.sendError(HttpServletResponse.SC_BAD_REQUEST);
return;
}
@@ -196,7 +196,7 @@ public class Login {
response.addCookie(c);
response.sendRedirect("/");
} else {
- response.sendError(403);
+ response.sendError(HttpServletResponse.SC_FORBIDDEN);
}
}
@@ -204,7 +204,7 @@ public class Login {
String username = request.getParameter("username");
String password = request.getParameter("password");
if (username == null || password == null || username.length() > 32 || password.isEmpty()) {
- response.sendError(400);
+ response.sendError(HttpServletResponse.SC_BAD_REQUEST);
return;
}
@@ -222,7 +222,7 @@ public class Login {
response.sendRedirect("/");
}
} else {
- response.sendError(403);
+ response.sendError(HttpServletResponse.SC_FORBIDDEN);
}
}