aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets
diff options
context:
space:
mode:
authorAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2016-06-27 16:06:53 +0200
committerAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2016-06-27 16:06:53 +0200
commit9440e26621193d138ebe26b32405b33d41b7c7ab (patch)
treea5e0001d80c6d2e9f82837fe334c222d11e7e6d3 /pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets
parent06cf27605579abab9d18615d1fef701b941e06f6 (diff)
downloadpdf-as-4-9440e26621193d138ebe26b32405b33d41b7c7ab.tar.gz
pdf-as-4-9440e26621193d138ebe26b32405b33d41b7c7ab.tar.bz2
pdf-as-4-9440e26621193d138ebe26b32405b33d41b7c7ab.zip
added configuration entry for json API
Diffstat (limited to 'pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets')
-rw-r--r--pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/JSONAPIServlet.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/JSONAPIServlet.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/JSONAPIServlet.java
index 1b9b4560..67b242d0 100644
--- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/JSONAPIServlet.java
+++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/JSONAPIServlet.java
@@ -56,6 +56,11 @@ public class JSONAPIServlet extends HttpServlet {
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
+ if(!WebConfiguration.isJSONAPIEnabled()) {
+ logger.info("Access to JSON API, but JSON API is disabled. Returning 404 error.");
+ resp.sendError(404);
+ }
+
String jsonString = IOUtils.toString(req.getInputStream(), "UTF-8");
logger.debug("Reading json String {}", jsonString);