Class AllowedHttpMethodsCustomizer

java.lang.Object
io.deephaven.server.jetty11.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 Summary

    Constructors
    Constructor
    Description
    Creates a new instance of the customizer, allowing only the specified HTTP methods.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    customize(org.eclipse.jetty.server.Connector connector, org.eclipse.jetty.server.HttpConfiguration httpConfiguration, org.eclipse.jetty.server.Request request)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.eclipse.jetty.server.HttpConfiguration.Customizer

    customize
  • 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 void customize(org.eclipse.jetty.server.Connector connector, org.eclipse.jetty.server.HttpConfiguration httpConfiguration, org.eclipse.jetty.server.Request request)