diff --git a/src/main/java/com/jenkinsci/plugins/badge/BadgePlugin.java b/src/main/java/com/jenkinsci/plugins/badge/BadgePlugin.java index 4f11979..0bbe424 100644 --- a/src/main/java/com/jenkinsci/plugins/badge/BadgePlugin.java +++ b/src/main/java/com/jenkinsci/plugins/badge/BadgePlugin.java @@ -35,6 +35,7 @@ import org.kohsuke.stapler.DataBoundSetter; import org.kohsuke.stapler.StaplerRequest; import org.kohsuke.stapler.StaplerResponse; +import org.kohsuke.stapler.interceptor.RequirePOST; import java.io.IOException; import java.util.List; @@ -78,10 +79,12 @@ public void setDisableFormatHTML(boolean disableFormatHTML) { save(); } + @RequirePOST public void doRemoveBadges(StaplerRequest req, StaplerResponse rsp) throws IOException { removeActions(BadgeAction.class, req, rsp); } + @RequirePOST public void doRemoveSummaries(StaplerRequest req, StaplerResponse rsp) throws IOException { removeActions(BadgeSummaryAction.class, req, rsp); } @@ -101,10 +104,12 @@ private void removeActions(Class type, StaplerRequest req, StaplerResponse rsp) } } + @RequirePOST public void doRemoveBadge(StaplerRequest req, StaplerResponse rsp) throws IOException { removeAction(BadgeAction.class, req, rsp); } + @RequirePOST public void doRemoveSummary(StaplerRequest req, StaplerResponse rsp) throws IOException { removeAction(BadgeSummaryAction.class, req, rsp); }