Class HttpVerbs
java.lang.Object
io.jenkins.plugins.batchcontrol.ui.HttpVerbs
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
public final class HttpVerbs
extends Object
HTTP verb guard for the Batch Control URL spaces.
The screens are served straight from index.jelly (no doIndex), and a Jelly
view renders for any verb. Nothing in these subtrees is modified by PUT,
DELETE or PATCH — records are append-only (SPEC item 4), and every state
change is a named @RequirePOST endpoint — so the section gates call
refuseUnsupported() to answer 405 for those verbs instead of rendering a page.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanrefuseNonGet(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) The GET-only guard for a read-only URL served by ado*method (JSON and CSV exports, redirect stubs): answers 405 withAllow: GET, HEADunless the request isGETorHEAD.static voidThrows a 405 response unless the current request isGET,HEADorPOST.
-
Method Details
-
refuseUnsupported
public static void refuseUnsupported()Throws a 405 response unless the current request isGET,HEADorPOST. Call it after the permission check, so an unauthorised caller learns nothing from the answer. -
refuseNonGet
public static boolean refuseNonGet(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException The GET-only guard for a read-only URL served by ado*method (JSON and CSV exports, redirect stubs): answers 405 withAllow: GET, HEADunless the request isGETorHEAD. Call it after the permission check.- Returns:
- true when the request was refused and the caller must return without writing
- Throws:
IOException
-