]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/api/APIPoint.java
add: email-management-api
[gigi.git] / src / org / cacert / gigi / api / APIPoint.java
index 684729123a8ed4b9230cd6c4810a305d3756201e..8987afdb4bf5f628e61c49c4448cdbfaebb7d32c 100644 (file)
@@ -24,6 +24,15 @@ public abstract class APIPoint {
             resp.sendError(403, "Error, cert authing required. Serial not found: " + serial);
             return;
         }
+        if (req.getMethod().equals("GET")) {
+            if (u instanceof User) {
+                processGet(req, resp, (User) u);
+                return;
+            } else {
+                resp.sendError(500, "Error, requires a User certificate.");
+                return;
+            }
+        }
 
         if ( !req.getMethod().equals("POST")) {
             resp.sendError(500, "Error, POST required.");
@@ -46,6 +55,10 @@ public abstract class APIPoint {
     }
 
     protected void process(HttpServletRequest req, HttpServletResponse resp, User u) throws IOException {
+        resp.sendError(500, "Error, Post not allowed.");
+    }
 
+    protected void processGet(HttpServletRequest req, HttpServletResponse resp, User u) throws IOException {
+        resp.sendError(500, "Error, Get not allowed.");
     }
 }