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 java.lang.Object implements HttpConfiguration.Customizer
Deprecated.The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.Customizes requests that lack theHost
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 theLocation
header is usually constructed from theHost
header; if theHost
header is missing, the server may query the connector for its IP address in order to construct theLocation
header, and thus leak to clients internal IP addresses.This
HttpConfiguration.Customizer
is configured with aserverName
and optionally aserverPort
. If theHost
header is absent, the configuredserverName
will be set on the request so thatServletRequest.getServerName()
will return that value, and likewise forserverPort
andServletRequest.getServerPort()
.
-
-
Constructor Summary
Constructors Constructor Description HostHeaderCustomizer(java.lang.String serverName)
Deprecated.HostHeaderCustomizer(java.lang.String serverName, int serverPort)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
customize(Connector connector, HttpConfiguration channelConfig, Request request)
Deprecated.
-
-
-
Constructor Detail
-
HostHeaderCustomizer
public HostHeaderCustomizer(java.lang.String serverName)
Deprecated.- Parameters:
serverName
- theserverName
to set on the request (theserverPort
will not be set)
-
HostHeaderCustomizer
public HostHeaderCustomizer(java.lang.String serverName, int serverPort)
Deprecated.- Parameters:
serverName
- theserverName
to set on the requestserverPort
- theserverPort
to set on the request
-
-
Method Detail
-
customize
public void customize(Connector connector, HttpConfiguration channelConfig, Request request)
Deprecated.- Specified by:
customize
in interfaceHttpConfiguration.Customizer
-
-