Class HTTP2ServerConnectionFactory.AltSvcCustomizer

java.lang.Object
org.eclipse.jetty.http2.server.HTTP2ServerConnectionFactory.AltSvcCustomizer
All Implemented Interfaces:
HttpConfiguration.Customizer
Enclosing class:
HTTP2ServerConnectionFactory

public static class HTTP2ServerConnectionFactory.AltSvcCustomizer extends Object implements HttpConfiguration.Customizer

An HttpConfiguration.Customizer that adds the Alt-Svc header to HTTP/2 responses, advertising HTTP/3 support if an HTTP/3 connector is available on the server.

  • Constructor Details

    • AltSvcCustomizer

      public AltSvcCustomizer()
  • Method Details

    • getMaxAge

      public Duration getMaxAge()
      Returns:
      The max age for the Alt-Svc response header, or null if no max-age attribute should be sent.
    • setMaxAge

      public void setMaxAge(Duration maxAge)
      Sets the Alt-Svc max age.
      Parameters:
      maxAge - the max age for the Alt-Svc response header, or null if no max-age attribute should be sent.
    • isPersist

      public boolean isPersist()
      Returns:
      whether the persist parameter should be included in the Alt-Svc header.
    • setPersist

      public void setPersist(boolean persist)
      Sets whether to include the persist parameter in the Alt-Svc header. When true, adds persist=1 to indicate the alternative service should be persisted across network changes.
      Parameters:
      persist - true to include the persist parameter, false otherwise.
      See Also:
    • customize

      public Request customize(Request request, HttpFields.Mutable responseHeaders)
      Specified by:
      customize in interface HttpConfiguration.Customizer