diff options
author | Vitaly Takmazov | 2016-11-23 12:08:45 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2016-11-23 12:08:45 +0300 |
commit | 42718787291bed507caf4f7ae13f6c41f9b8d7ff (patch) | |
tree | 2ba7bb057a6a740e98c5f4d6dae813af1a6b977f /juick-www/src/main/java/com/juick/www/Main.java | |
parent | aa3c1a06ed46f49b617e2956b6cf9a1b0d367fb0 (diff) |
using HttpServletResponse status codes
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 | 28 |
1 files changed, 14 insertions, 14 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 075b33fa..99d06fe6 100644 --- a/juick-www/src/main/java/com/juick/www/Main.java +++ b/juick-www/src/main/java/com/juick/www/Main.java @@ -182,7 +182,7 @@ public class Main extends HttpServlet { pm.doGetInbox(sql, request, response, visitor); } catch (PebbleException e) { log("pebble exception", e); - response.sendError(500); + response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } break; case "/pm/sent": @@ -190,7 +190,7 @@ public class Main extends HttpServlet { pm.doGetSent(sql, request, response, visitor); } catch (PebbleException e) { log("pebble exception", e); - response.sendError(500); + response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } break; default: @@ -206,10 +206,10 @@ public class Main extends HttpServlet { rss.doGet(sql, response, uid); } catch (PebbleException e) { log("pebble exception", e); - response.sendError(500); + response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } } else { - response.sendError(404); + response.sendError(HttpServletResponse.SC_NOT_FOUND); } } else if (uri.equals("/logout")) { login.doGetLogout(sql, request, response); @@ -218,7 +218,7 @@ public class Main extends HttpServlet { settings.doGet(sql, request, response); } catch (PebbleException e) { log("pebble exception", e); - response.sendError(500); + response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } } else if (uri.equals("/_fblogin")) { loginFacebook.doGet(sql, request, response); @@ -231,7 +231,7 @@ public class Main extends HttpServlet { signup.doGet(sql, request, response); } catch (PebbleException e) { log("pebble exception", e); - response.sendError(500); + response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } } else if (uri.equals("/help") || uri.equals("/help/")) { help.doRedirectToHelpIndex(response); @@ -240,10 +240,10 @@ public class Main extends HttpServlet { help.doGetHelp(sql, request, response); } catch (PebbleException e) { log("pebble exception", e); - response.sendError(500); + response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } catch (URISyntaxException e) { log("help exception", e); - response.sendError(500); + response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } } else if (uri.startsWith("/tag/")) { discover.doGet(sql, sqlSearch, request, response); @@ -332,7 +332,7 @@ public class Main extends HttpServlet { if (visitor.getUid() > 0 && !visitor.isBanned()) { pagesNewMessage.doPostMessage(sql, request, response, xmpp, visitor); } else { - response.sendError(403); + response.sendError(HttpServletResponse.SC_FORBIDDEN); } break; } @@ -341,7 +341,7 @@ public class Main extends HttpServlet { if (visitor.getUid() > 0 && !visitor.isBanned()) { pagesNewMessage.doPostComment(sql, request, response, xmpp, visitor); } else { - response.sendError(403); + response.sendError(HttpServletResponse.SC_FORBIDDEN); } break; } @@ -350,7 +350,7 @@ public class Main extends HttpServlet { if (visitor.getUid() > 0 && !visitor.isBanned()) { pagesNewMessage.doPostRecomm(sql, request, response, xmpp, visitor); } else { - response.sendError(403); + response.sendError(HttpServletResponse.SC_FORBIDDEN); } break; } @@ -359,7 +359,7 @@ public class Main extends HttpServlet { if (visitor.getUid() > 0 && !visitor.isBanned()) { pm.doPostPM(sql, request, response, xmpp, visitor); } else { - response.sendError(403); + response.sendError(HttpServletResponse.SC_FORBIDDEN); } break; } @@ -374,11 +374,11 @@ public class Main extends HttpServlet { settings.doPost(sql, request, response); } catch (PebbleException e) { log("pebble exception", e); - response.sendError(500); + response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } break; default: - response.sendError(405); + response.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED); break; } } |