Class DefaultHttpHostResolver

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.String getConfiguredHost​(io.micronaut.http.HttpRequest request, HttpServerConfiguration.HostResolutionConfiguration configuration)  
      protected java.lang.String getConfiguredHost​(io.micronaut.http.HttpRequest request, java.lang.String schemeHeader, java.lang.String hostHeader, java.lang.String portHeader, boolean isPortInHost)  
      protected java.lang.String getDefaultHost​(io.micronaut.http.HttpRequest request)  
      protected java.lang.String getEmbeddedHost()  
      java.lang.String resolve​(io.micronaut.http.HttpRequest request)
      Returns the host of the current server with protocol, host name, and an optional port.
      protected java.lang.String validateHost​(java.lang.String host)
      Validates the host transforming the host value if necessary.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultHttpHostResolver

        @Inject
        public DefaultHttpHostResolver​(HttpServerConfiguration serverConfiguration,
                                       @Nullable
                                       io.micronaut.context.BeanProvider<io.micronaut.runtime.server.EmbeddedServer> embeddedServer)
        Parameters:
        serverConfiguration - The server configuration
        embeddedServer - The embedded server provider
    • Method Detail

      • resolve

        @NonNull
        public java.lang.String resolve​(@Nullable
                                        io.micronaut.http.HttpRequest request)
        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 java.lang.String validateHost​(@NonNull
                                                java.lang.String host)
        Validates the host transforming the host value if necessary.
        Parameters:
        host - The host
        Returns:
        The transformed host
      • getEmbeddedHost

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

        protected java.lang.String getDefaultHost​(io.micronaut.http.HttpRequest request)
        Parameters:
        request - The current request
        Returns:
        The default host
      • getConfiguredHost

        protected java.lang.String getConfiguredHost​(io.micronaut.http.HttpRequest request,
                                                     HttpServerConfiguration.HostResolutionConfiguration configuration)
        Parameters:
        request - The current request
        configuration - The configuration
        Returns:
        The configured host
      • getConfiguredHost

        protected java.lang.String getConfiguredHost​(io.micronaut.http.HttpRequest request,
                                                     java.lang.String schemeHeader,
                                                     java.lang.String hostHeader,
                                                     java.lang.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