diff options
author | 2016-05-12 22:30:23 +0300 | |
---|---|---|
committer | 2016-05-12 22:30:23 +0300 | |
commit | 01cf5ebb4e9db6458bdda762454b699593f796f5 (patch) | |
tree | 643bec9d79bb225fa4194549a163811c5e372423 /src/main/java/com/juick/api/Main.java | |
parent | c58e021d8631fd8e1dd1d40546a4aabce27e2cdf (diff) |
use post not get
Diffstat (limited to 'src/main/java/com/juick/api/Main.java')
-rw-r--r-- | src/main/java/com/juick/api/Main.java | 15 |
1 files changed, 6 insertions, 9 deletions
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; |