aboutsummaryrefslogtreecommitdiff
path: root/juick-www/src/main/java/com/juick/www/Settings.java
diff options
context:
space:
mode:
Diffstat (limited to 'juick-www/src/main/java/com/juick/www/Settings.java')
-rw-r--r--juick-www/src/main/java/com/juick/www/Settings.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/juick-www/src/main/java/com/juick/www/Settings.java b/juick-www/src/main/java/com/juick/www/Settings.java
index 5c25564f..89eb6718 100644
--- a/juick-www/src/main/java/com/juick/www/Settings.java
+++ b/juick-www/src/main/java/com/juick/www/Settings.java
@@ -118,7 +118,7 @@ public class Settings {
protected void doPost(JdbcTemplate sql, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, PebbleException {
com.juick.User visitor = Utils.getVisitorUser(sql, request, response);
if (visitor.getUid() == 0) {
- response.sendError(400);
+ response.sendError(HttpServletResponse.SC_BAD_REQUEST);
return;
}
List<String> pages = Arrays.asList("main", "password", "about", "email", "email-add", "email-del",
@@ -126,7 +126,7 @@ public class Settings {
"facebook-enable", "vk-del");
String page = request.getParameter("page");
if (StringUtils.isEmpty(page) || !pages.contains(page)) {
- response.sendError(400);
+ response.sendError(HttpServletResponse.SC_BAD_REQUEST);
return;
}
String result = "";
@@ -191,7 +191,7 @@ public class Settings {
result = String.format("<p>New secret email: <strong>%s@mail.juick.com</strong></p>" +
"<p><a href=\"/settings\">Back</a>.</p>", newHash);
} else {
- response.sendError(500);
+ response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
return;
}
break;
@@ -218,7 +218,7 @@ public class Settings {
} catch (MessagingException ex) {
logger.error("mail exception", ex);
- response.sendError(500);
+ response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
return;
}
}
@@ -277,7 +277,7 @@ public class Settings {
result = "<p><a href=\"/settings\">Back</a></p>";
break;
default:
- response.sendError(400);
+ response.sendError(HttpServletResponse.SC_BAD_REQUEST);
return;
}
response.setContentType("text/html; charset=UTF-8");