Class ResourceDomainConfiguration

All Implemented Interfaces:
ExtensionPoint, Describable<GlobalConfiguration>, Saveable, Loadable, OnMaster

@Extension(ordinal=199.0) @Restricted(org.kohsuke.accmod.restrictions.Beta.class) @Symbol("resourceRoot") public final class ResourceDomainConfiguration extends GlobalConfiguration
Configure the resource root URL, an alternative root URL to serve resources from to not need Content-Security-Policy headers, which mess with desired complex output.
Since:
2.200, unrestricted since 2.203
See Also:
  • Constructor Details

    • ResourceDomainConfiguration

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public ResourceDomainConfiguration()
  • Method Details

    • doCheckUrl

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @POST public FormValidation doCheckUrl(@QueryParameter("url") String resourceRootUrlString)
    • getUrl

      @CheckForNull public String getUrl()
    • setUrl

      public void setUrl(@CheckForNull String url)
    • isResourceRequest

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static boolean isResourceRequest(jakarta.servlet.http.HttpServletRequest req)
      Returns true if and only if this is a request to URLs under the resource root URL. For this to be the case, the requested host and port (from the Host HTTP request header) must match what is configured for the resource root URL.
      Parameters:
      req - the request to check
      Returns:
      whether the request is a resource URL request
    • isResourceDomainConfigured

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static boolean isResourceDomainConfigured()
      Returns true if and only if a domain has been configured to serve resource URLs from
      Returns:
      whether a domain has been configured
    • get

      public static ResourceDomainConfiguration get()