public static String cleanVirtualHost(String host){
  host=substringBefore(host,'\0');
  if (host.endsWith(".")) {
    host=host.substring(0,host.length() - 1);
  }
  return host;
}

public static String cleanVirtualHost ( String host ) { host = substringBefore ( host , '\0' ) ; if ( host . endsWith ( "." ) ) { host = host . substring ( 0 , host . length ( ) - 1 ) ; } return host ; }
returns the cleaned hostname for the input sent by the client .
