extractHostName

extractHostName

Extract the hostname part of the Host request header and expose it as a String extraction to its inner route.

§Example

  1. final Route route = extractHost(hn ->
  2. complete("Hostname: " + hn));
  3.  
  4. testRoute(route).run(HttpRequest.GET("/").addHeader(Host.create("company.com", 9090)))
  5. .assertEntity("Hostname: company.com");

Contents