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 Type
    Method
    Description
    static boolean
    refuseNonGet(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp)
    The GET-only guard for a read-only URL served by a do* method (JSON and CSV exports, redirect stubs): answers 405 with Allow: GET, HEAD unless the request is GET or HEAD.
    static void
    Throws a 405 response unless the current request is GET, HEAD or POST.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • refuseUnsupported

      public static void refuseUnsupported()
      Throws a 405 response unless the current request is GET, HEAD or POST. 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 a do* method (JSON and CSV exports, redirect stubs): answers 405 with Allow: GET, HEAD unless the request is GET or HEAD. Call it after the permission check.
      Returns:
      true when the request was refused and the caller must return without writing
      Throws:
      IOException