From 01cf5ebb4e9db6458bdda762454b699593f796f5 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 12 May 2016 22:30:23 +0300 Subject: use post not get --- src/main/java/com/juick/api/Main.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/main/java/com/juick/api/Main.java b/src/main/java/com/juick/api/Main.java index 7d5c8f1b..7a571fe0 100644 --- a/src/main/java/com/juick/api/Main.java +++ b/src/main/java/com/juick/api/Main.java @@ -128,10 +128,7 @@ public class Main extends HttpServlet implements Stream.StreamListener { } String uri = request.getRequestURI(); - if (uri.equals("/tlgmbtwbhk")) { - tgb.doPost(request, response); - return; - } + int vuid = Utils.getHttpAuthUID(jdbc, request); if (vuid == 0) { vuid = Utils.getVisitorQueryStringUID(jdbc, request); @@ -192,6 +189,11 @@ public class Main extends HttpServlet implements Stream.StreamListener { if (request.getCharacterEncoding() == null) { request.setCharacterEncoding("UTF-8"); } + String uri = request.getRequestURI(); + if (uri.equals("/tlgmbtwbhk")) { + tgb.doPost(request, response); + return; + } int vuid = Utils.getHttpAuthUID(jdbc, request); if (vuid == 0) { @@ -201,8 +203,6 @@ public class Main extends HttpServlet implements Stream.StreamListener { response.sendError(401); return; } - - String uri = request.getRequestURI(); switch (uri) { case "/post": int mid = Utils.parseInt(request.getParameter("mid"), 0); @@ -215,9 +215,6 @@ public class Main extends HttpServlet implements Stream.StreamListener { case "/pm": pm.doPostPM(request, response, xmpp, vuid); break; - case "/tlgmbtwbhk": - tgb.doPost(request, response); - break; default: response.sendError(405); break; -- cgit v1.2.3