diff options
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.java | 5 |
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); |