From cabf47f13177e5006f2e3f0a64929d23ac2b995c Mon Sep 17 00:00:00 2001 From: strangelookingnerd <49242855+strangelookingnerd@users.noreply.github.com> Date: Sat, 11 May 2024 13:45:50 +0200 Subject: [PATCH] Missing POST/RequirePOST annotation --- src/main/java/com/jenkinsci/plugins/badge/BadgePlugin.java | 5 +++++ 1 file changed, 5 insertions(+) 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); }