X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=src%2Forg%2Fcacert%2Fgigi%2Fapi%2FAPIPoint.java;h=8987afdb4bf5f628e61c49c4448cdbfaebb7d32c;hp=684729123a8ed4b9230cd6c4810a305d3756201e;hb=10eeb7050f199457d451d0576e443d8d85d1146e;hpb=e79c07912f681f445446b295f3be7dfa607a3e15 diff --git a/src/org/cacert/gigi/api/APIPoint.java b/src/org/cacert/gigi/api/APIPoint.java index 68472912..8987afdb 100644 --- a/src/org/cacert/gigi/api/APIPoint.java +++ b/src/org/cacert/gigi/api/APIPoint.java @@ -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."); } }