Package org.eclipse.jetty.server
Class HostHeaderCustomizer
java.lang.Object
org.eclipse.jetty.server.HostHeaderCustomizer
- All Implemented Interfaces:
HttpConfiguration.Customizer
Adds a missing
Host
header (for example, HTTP 1.0 or 2.0 requests).
The host and port may be provided in the constructor or taken from the
Request.getServerName()
and Request.getServerPort()
methods.
-
Constructor Summary
ConstructorDescriptionConstruct customizer that usesRequest.getServerName()
andRequest.getServerPort()
to create a host header.HostHeaderCustomizer
(String serverName) HostHeaderCustomizer
(String serverName, int serverPort) -
Method Summary
Modifier and TypeMethodDescriptionvoid
customize
(Connector connector, HttpConfiguration channelConfig, Request request)
-
Constructor Details
-
HostHeaderCustomizer
public HostHeaderCustomizer()Construct customizer that usesRequest.getServerName()
andRequest.getServerPort()
to create a host header. -
HostHeaderCustomizer
- Parameters:
serverName
- theserverName
to set on the request (theserverPort
will not be set)
-
HostHeaderCustomizer
- Parameters:
serverName
- theserverName
to set on the requestserverPort
- theserverPort
to set on the request
-
-
Method Details
-
customize
- Specified by:
customize
in interfaceHttpConfiguration.Customizer
-