Package org.eclipse.jetty.http2.server
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncustomize(Request request, HttpFields.Mutable responseHeaders) booleanvoidSets the Alt-Svc max age.voidsetPersist(boolean persist) Sets whether to include the persist parameter in the Alt-Svc header.
-
Constructor Details
-
AltSvcCustomizer
public AltSvcCustomizer()
-
-
Method Details
-
getMaxAge
- Returns:
- The max age for the Alt-Svc response header, or null if no max-age attribute should be sent.
-
setMaxAge
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, addspersist=1to indicate the alternative service should be persisted across network changes.- Parameters:
persist- true to include the persist parameter, false otherwise.- See Also:
-
customize
- Specified by:
customizein interfaceHttpConfiguration.Customizer
-