public class ForwardedRequestCustomizer extends Object implements HttpConfiguration.Customizer
This customizer looks at at HTTP request for headers that indicate it has been forwarded by one or more proxies. Specifically handled are:
If these headers are present, then the Request
object is updated
so that the proxy is not seen as the other end point of the connection on which
the request came
Headers can also be defined so that forwarded SSL Session IDs and Cipher suites may be customised
Constructor and Description |
---|
ForwardedRequestCustomizer() |
Modifier and Type | Method and Description |
---|---|
void |
customize(Connector connector,
HttpConfiguration config,
Request request) |
String |
getForwardedCipherSuiteHeader() |
String |
getForwardedForHeader() |
String |
getForwardedHostHeader() |
String |
getForwardedProtoHeader()
Get the forwardedProtoHeader.
|
String |
getForwardedServerHeader() |
String |
getForwardedSslSessionIdHeader() |
String |
getHostHeader() |
protected String |
getLeftMostFieldValue(HttpFields fields,
String header) |
void |
setForwardedCipherSuiteHeader(String forwardedCipherSuite) |
void |
setForwardedForHeader(String forwardedRemoteAddressHeader) |
void |
setForwardedHostHeader(String forwardedHostHeader) |
void |
setForwardedProtoHeader(String forwardedProtoHeader)
Set the forwardedProtoHeader.
|
void |
setForwardedServerHeader(String forwardedServerHeader) |
void |
setForwardedSslSessionIdHeader(String forwardedSslSessionId) |
void |
setHostHeader(String hostHeader)
Set a forced valued for the host header to control what is returned by
ServletRequest#getServerName() and ServletRequest#getServerPort() . |
String |
toString() |
public String getHostHeader()
public void setHostHeader(String hostHeader)
ServletRequest#getServerName()
and ServletRequest#getServerPort()
.hostHeader
- The value of the host header to force.public String getForwardedHostHeader()
public void setForwardedHostHeader(String forwardedHostHeader)
forwardedHostHeader
- The header name for forwarded hosts (default x-forwarded-host)public String getForwardedServerHeader()
public void setForwardedServerHeader(String forwardedServerHeader)
forwardedServerHeader
- The header name for forwarded server (default x-forwarded-server)public String getForwardedForHeader()
public void setForwardedForHeader(String forwardedRemoteAddressHeader)
forwardedRemoteAddressHeader
- The header name for forwarded for (default x-forwarded-for)public String getForwardedProtoHeader()
public void setForwardedProtoHeader(String forwardedProtoHeader)
forwardedProtoHeader
- the forwardedProtoHeader to set (default X-Forwarded-For)public String getForwardedCipherSuiteHeader()
public void setForwardedCipherSuiteHeader(String forwardedCipherSuite)
forwardedCipherSuite
- The header name holding a forwarded cipher suite (default null)public String getForwardedSslSessionIdHeader()
public void setForwardedSslSessionIdHeader(String forwardedSslSessionId)
forwardedSslSessionId
- The header name holding a forwarded SSL Session ID (default null)public void customize(Connector connector, HttpConfiguration config, Request request)
customize
in interface HttpConfiguration.Customizer
protected String getLeftMostFieldValue(HttpFields fields, String header)
Copyright © 1995-2015 Webtide. All Rights Reserved.