aboutsummaryrefslogtreecommitdiff
path: root/src/java/com/juick/api/Main.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/com/juick/api/Main.java')
-rw-r--r--src/java/com/juick/api/Main.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/java/com/juick/api/Main.java b/src/java/com/juick/api/Main.java
index 38716282..9e0b8523 100644
--- a/src/java/com/juick/api/Main.java
+++ b/src/java/com/juick/api/Main.java
@@ -29,6 +29,7 @@ import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Properties;
import javax.servlet.ServletException;
+import javax.servlet.annotation.MultipartConfig;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
@@ -39,6 +40,7 @@ import javax.servlet.http.HttpServletResponse;
* @author Ugnich Anton
*/
@WebServlet(name = "Main", urlPatterns = {"/"})
+@MultipartConfig
public class Main extends HttpServlet implements Stream.StreamListener {
Connection sql;
@@ -186,16 +188,15 @@ public class Main extends HttpServlet implements Stream.StreamListener {
if (vuid == 0) {
vuid = Utils.getVisitorQueryStringUID(sql, request);
}
-
+ if (vuid == 0) {
+ response.sendError(401);
+ return;
+ }
String uri = request.getRequestURI();
if (uri.equals("/post")) {
} else if (uri.equals("/pm")) {
- if (vuid > 0) {
- pm.doPostPM(request, response, xmpp, vuid);
- } else {
- response.sendError(401);
- }
+ pm.doPostPM(request, response, xmpp, vuid);
} else {
response.sendError(405);
}