Class AllowedHttpMethodsCustomizer

java.lang.Object
io.deephaven.server.jetty.AllowedHttpMethodsCustomizer
All Implemented Interfaces:
org.eclipse.jetty.server.HttpConfiguration.Customizer

public class AllowedHttpMethodsCustomizer extends Object implements org.eclipse.jetty.server.HttpConfiguration.Customizer
Limits the allowed HTTP methods to those specified in the configuration. When set on the http configuration itself, this is applied for all calls made to the server, regardless of context.

For the deephaven-core server, we need to allow only one HTTP method, with two other optional ones, depending on how the server is to be used.

  • POST - required for the server to be useful at all, used for all gRPC endpoints that deephaven-core supports.
  • GET - optional, likely only needed for browser clients at this time.
  • OPTIONS - optional, necessary for CORS requests.
  • Constructor Details

    • AllowedHttpMethodsCustomizer

      public AllowedHttpMethodsCustomizer(Set<String> allowedMethods)
      Creates a new instance of the customizer, allowing only the specified HTTP methods.
      Parameters:
      allowedMethods - the HTTP methods to allow
  • Method Details

    • customize

      public org.eclipse.jetty.server.Request customize(org.eclipse.jetty.server.Request request, org.eclipse.jetty.http.HttpFields.Mutable mutable)
      Specified by:
      customize in interface org.eclipse.jetty.server.HttpConfiguration.Customizer