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 Details

    • HostResolutionConfiguration

      public HostResolutionConfiguration()
  • Method Details

    • getHostHeader

      public String getHostHeader()
      Returns:
      The host header name
    • setHostHeader

      public void setHostHeader(String hostHeader)
      Parameters:
      hostHeader - The header name that stores the host
    • getProtocolHeader

      public String getProtocolHeader()
      Returns:
      The protocol header name
    • setProtocolHeader

      public void setProtocolHeader(String protocolHeader)
      Parameters:
      protocolHeader - The header name that stores the protocol
    • getPortHeader

      public String getPortHeader()
      Returns:
      The port header name
    • setPortHeader

      public void setPortHeader(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 List<Pattern> getAllowedHosts()
      Returns:
      The list of hosts to validate the resolved host against.
    • setAllowedHosts

      public void setAllowedHosts(List<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 through Pattern.compile(String).
    • headersConfigured

      public boolean headersConfigured()
      Returns:
      True if any host headers have been configured