diff --git a/tool/src/main/java/migt/ExecuteWebServer.java b/tool/src/main/java/migt/ExecuteWebServer.java index 4fd8497..672dc3b 100644 --- a/tool/src/main/java/migt/ExecuteWebServer.java +++ b/tool/src/main/java/migt/ExecuteWebServer.java @@ -98,6 +98,10 @@ public void handle(String target, org.eclipse.jetty.server.Request baseRequest, response.setHeader("Access-Control-Allow-Headers", "Content-Type, Authorization"); if("/execute".equals(target) && baseRequest.getMethod().equals("POST")) { + // read param onlyValidate + String onlyValidateStr = request.getParameter("onlyValidate"); + boolean onlyValidate = Boolean.parseBoolean(onlyValidateStr); + // read content JsonObject body = new Gson().fromJson(request.getReader(), TypeToken.get(JsonObject.class)); @@ -126,7 +130,9 @@ public void handle(String target, org.eclipse.jetty.server.Request baseRequest, result.addProperty("success", true); } - mainPane.btnExecuteSuite.doClick(); + if(!onlyValidate) { + mainPane.btnExecuteSuite.doClick(); + } writeOutputJson(result, response.getWriter()); baseRequest.setHandled(true); @@ -150,7 +156,7 @@ public void handle(String target, org.eclipse.jetty.server.Request baseRequest, record.addProperty("description", t.getDescription()); record.addProperty("type", t.isActive ? "active" : "passive"); record.addProperty("mitigations", t.mitigations); - record.addProperty("result", t.applicable ? (t.success ? "success" : "failed") : "not applicable"); + record.addProperty("result", t.applicable ? (t.success ? "passed" : "failed") : "not applicable"); /* record.addProperty("statements", ""); System.out.println("Affected entity: " + t.affected_entity); record.add("affected entity", JsonNull.INSTANCE); */ diff --git a/tool/src/main/java/migt/Main.java b/tool/src/main/java/migt/Main.java index 30ec20b..b35cc9a 100644 --- a/tool/src/main/java/migt/Main.java +++ b/tool/src/main/java/migt/Main.java @@ -189,7 +189,6 @@ public Main() { //-------------------------------------- //DRIVER_PATH = Main.class.getClassLoader().getResource("driver/geckodriver").getPath(); //DRIVER_PATH = JOptionPane.showInputDialog(null, "enter the driver path:"); - DRIVER_PATH = "/usr/local/bin/geckodriver"; //-------------------------------------- if (!DRIVER_PATH.equals("")) {