@Singleton public class DefaultHttpHostResolver extends java.lang.Object implements HttpHostResolver
HttpHostResolver
.Constructor and Description |
---|
DefaultHttpHostResolver(HttpServerConfiguration serverConfiguration,
javax.inject.Provider<EmbeddedServer> embeddedServer) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
getConfiguredHost(HttpRequest request,
HttpServerConfiguration.HostResolutionConfiguration configuration) |
protected java.lang.String |
getConfiguredHost(HttpRequest request,
java.lang.String schemeHeader,
java.lang.String hostHeader,
java.lang.String portHeader,
boolean isPortInHost) |
protected java.lang.String |
getDefaultHost(HttpRequest request) |
protected java.lang.String |
getEmbeddedHost() |
java.lang.String |
resolve(HttpRequest request)
Returns the host of the current server with
protocol, host name, and an optional port.
|
public DefaultHttpHostResolver(HttpServerConfiguration serverConfiguration, javax.inject.Provider<EmbeddedServer> embeddedServer)
serverConfiguration
- The server configurationembeddedServer
- The embedded server provider@NonNull public java.lang.String resolve(@Nullable HttpRequest request)
HttpHostResolver
resolve
in interface HttpHostResolver
request
- The current requestprotected java.lang.String getEmbeddedHost()
protected java.lang.String getDefaultHost(HttpRequest request)
request
- The current requestprotected java.lang.String getConfiguredHost(HttpRequest request, HttpServerConfiguration.HostResolutionConfiguration configuration)
request
- The current requestconfiguration
- The configurationprotected java.lang.String getConfiguredHost(HttpRequest request, java.lang.String schemeHeader, java.lang.String hostHeader, java.lang.String portHeader, boolean isPortInHost)
request
- The current requestschemeHeader
- The scheme or protocol header namehostHeader
- The host header nameportHeader
- The port header nameisPortInHost
- If the port can be part of the host value