Class DefaultHttpHostResolver

java.lang.Object
io.micronaut.http.server.util.DefaultHttpHostResolver
All Implemented Interfaces:
HttpHostResolver

@Singleton public class DefaultHttpHostResolver extends Object implements HttpHostResolver
Default implementation of HttpHostResolver.
Since:
1.2.0
Author:
James Kleeh
  • Constructor Details

  • Method Details

    • resolve

      Description copied from interface: HttpHostResolver
      Returns the host of the current server with protocol, host name, and an optional port.
      Specified by:
      resolve in interface HttpHostResolver
      Parameters:
      request - The current request
      Returns:
      The host information
    • validateHost

      @NonNull protected @NonNull String validateHost(@NonNull @NonNull String host)
      Validates the host transforming the host value if necessary.
      Parameters:
      host - The host
      Returns:
      The transformed host
    • getEmbeddedHost

      protected String getEmbeddedHost()
      Returns:
      The host resolved from the embedded server
    • getDefaultHost

      protected String getDefaultHost(HttpRequest request)
      Parameters:
      request - The current request
      Returns:
      The default host
    • getConfiguredHost

      protected String getConfiguredHost(HttpRequest request, HttpServerConfiguration.HostResolutionConfiguration configuration)
      Parameters:
      request - The current request
      configuration - The configuration
      Returns:
      The configured host
    • getConfiguredHost

      protected String getConfiguredHost(HttpRequest request, String schemeHeader, String hostHeader, String portHeader, boolean isPortInHost)
      Parameters:
      request - The current request
      schemeHeader - The scheme or protocol header name
      hostHeader - The host header name
      portHeader - The port header name
      isPortInHost - If the port can be part of the host value
      Returns:
      The configured host