Package org.eclipse.jetty.server
Class HostHeaderCustomizer
java.lang.Object
org.eclipse.jetty.server.HostHeaderCustomizer
- All Implemented Interfaces:
HttpConfiguration.Customizer
@Deprecated(since="2021-05-27")
public class HostHeaderCustomizer
extends Object
implements HttpConfiguration.Customizer
Deprecated.
The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.
Customizes requests that lack the
Host
header (for example, HTTP 1.0 requests).
In case of HTTP 1.0 requests that lack the Host
header, the application may issue
a redirect, and the Location
header is usually constructed from the Host
header; if the Host
header is missing, the server may query the connector for its
IP address in order to construct the Location
header, and thus leak to clients
internal IP addresses.
This HttpConfiguration.Customizer
is configured with a serverName
and
optionally a serverPort
.
If the Host
header is absent, the configured serverName
will be set on
the request so that ServletRequest.getServerName()
will return that value,
and likewise for serverPort
and ServletRequest.getServerPort()
.
-
Constructor Summary
ConstructorsConstructorDescriptionHostHeaderCustomizer
(String serverName) Deprecated.HostHeaderCustomizer
(String serverName, int serverPort) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoid
customize
(Connector connector, HttpConfiguration channelConfig, Request request) Deprecated.
-
Constructor Details
-
HostHeaderCustomizer
Deprecated.- Parameters:
serverName
- theserverName
to set on the request (theserverPort
will not be set)
-
HostHeaderCustomizer
Deprecated.- Parameters:
serverName
- theserverName
to set on the requestserverPort
- theserverPort
to set on the request
-
-
Method Details
-
customize
Deprecated.- Specified by:
customize
in interfaceHttpConfiguration.Customizer
-