Package io.micronaut.http.server
Class HttpServerConfiguration.HostResolutionConfiguration
java.lang.Object
io.micronaut.http.server.HttpServerConfiguration.HostResolutionConfiguration
- Enclosing class:
- HttpServerConfiguration
@ConfigurationProperties("host-resolution")
public static class HttpServerConfiguration.HostResolutionConfiguration
extends Object
Configuration for host resolution with the
HttpHostResolver
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
void
setAllowedHosts
(List<String> allowedHosts) void
setHostHeader
(String hostHeader) void
setPortHeader
(String portHeader) void
setPortInHost
(boolean portInHost) void
setProtocolHeader
(String protocolHeader)
-
Constructor Details
-
HostResolutionConfiguration
public HostResolutionConfiguration()
-
-
Method Details
-
getHostHeader
- Returns:
- The host header name
-
setHostHeader
- Parameters:
hostHeader
- The header name that stores the host
-
getProtocolHeader
- Returns:
- The protocol header name
-
setProtocolHeader
- Parameters:
protocolHeader
- The header name that stores the protocol
-
getPortHeader
- Returns:
- The port header name
-
setPortHeader
- Parameters:
portHeader
- The header name that stores the port
-
isPortInHost
public boolean isPortInHost()- Returns:
- If the host header supports a port
-
setPortInHost
public void setPortInHost(boolean portInHost) - Parameters:
portInHost
- True if the host header supports a port appended with:
. Default value (DEFAULT_PORT_IN_HOST
).
-
getAllowedHosts
- Returns:
- The list of hosts to validate the resolved host against.
-
setAllowedHosts
- Parameters:
allowedHosts
- The list of allowed host regex patterns. Any resolved host must match one of the configured hosts if the list is supplied. Each host is passed throughPattern.compile(String)
.
-
headersConfigured
public boolean headersConfigured()- Returns:
- True if any host headers have been configured
-