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 java.lang.ObjectConfiguration for host resolution with theHttpHostResolver.
-
-
Constructor Summary
Constructors Constructor Description HostResolutionConfiguration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.util.regex.Pattern>getAllowedHosts()java.lang.StringgetHostHeader()java.lang.StringgetPortHeader()java.lang.StringgetProtocolHeader()booleanheadersConfigured()booleanisPortInHost()voidsetAllowedHosts(java.util.List<java.lang.String> allowedHosts)voidsetHostHeader(java.lang.String hostHeader)voidsetPortHeader(java.lang.String portHeader)voidsetPortInHost(boolean portInHost)voidsetProtocolHeader(java.lang.String protocolHeader)
-
-
-
Method Detail
-
getHostHeader
public java.lang.String getHostHeader()
- Returns:
- The host header name
-
setHostHeader
public void setHostHeader(java.lang.String hostHeader)
- Parameters:
hostHeader- The header name that stores the host
-
getProtocolHeader
public java.lang.String getProtocolHeader()
- Returns:
- The protocol header name
-
setProtocolHeader
public void setProtocolHeader(java.lang.String protocolHeader)
- Parameters:
protocolHeader- The header name that stores the protocol
-
getPortHeader
public java.lang.String getPortHeader()
- Returns:
- The port header name
-
setPortHeader
public void setPortHeader(java.lang.String portHeader)
- 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
public java.util.List<java.util.regex.Pattern> getAllowedHosts()
- Returns:
- The list of hosts to validate the resolved host against.
-
setAllowedHosts
public void setAllowedHosts(java.util.List<java.lang.String> allowedHosts)
- 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
-
-