aboutsummaryrefslogtreecommitdiff
path: root/juick-api/src/main/java/com/juick/api/ApiServer.java
diff options
context:
space:
mode:
Diffstat (limited to 'juick-api/src/main/java/com/juick/api/ApiServer.java')
-rw-r--r--juick-api/src/main/java/com/juick/api/ApiServer.java24
1 files changed, 0 insertions, 24 deletions
diff --git a/juick-api/src/main/java/com/juick/api/ApiServer.java b/juick-api/src/main/java/com/juick/api/ApiServer.java
index c76c165a..80b2b31b 100644
--- a/juick-api/src/main/java/com/juick/api/ApiServer.java
+++ b/juick-api/src/main/java/com/juick/api/ApiServer.java
@@ -28,10 +28,6 @@ import rocks.xmpp.core.session.XmppSessionConfiguration;
import rocks.xmpp.extensions.component.accept.ExternalComponent;
import javax.annotation.PostConstruct;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.io.PrintWriter;
/**
* @author Ugnich Anton
@@ -91,26 +87,6 @@ public class ApiServer implements AutoCloseable {
}
}
- public static void replyJSON(HttpServletRequest request, HttpServletResponse response, String json) throws IOException {
- response.setContentType("application/json; charset=UTF-8");
- response.setHeader("Access-Control-Allow-Origin", "*");
-
- String callback = request.getParameter("callback");
- if (callback != null && (callback.length() > 64 || !callback.matches("[a-zA-Z0-9\\-\\_]+"))) {
- callback = null;
- }
-
- try (PrintWriter out = response.getWriter()) {
- if (callback != null) {
- out.print(callback + "(");
- out.print(json);
- out.print(")");
- } else {
- out.print(json);
- }
- }
- }
-
public ExternalComponent getXmpp() {
return xmpp;
}