code: @Override
      public boolean isPreServiceUrl(String audience) {
          // check the https or https first
          if (this.httpHostStr == null) {
              String httpStr = "http://";
              this.bSecuredHttp = request.isSecure();
              if (this.bSecuredHttp) {
                  httpStr = "https://";
              }
              httpHostStr = httpStr + request.getServerName();
              this.serverPort = request.getServerPort();
          }
          if (!audience.startsWith(this.httpHostStr))
              return false;
  
          String portAudience = audience.substring(this.httpHostStr.length());
          // let's check the port
          if (portAudience.isEmpty() || portAudience.startsWith("/")) {
              // no port defined in audience
              if (this.serverPort == -1)
                  return true; // TODO somehow the httpServerRequest does not know the port number...
              if (this.bSecuredHttp) {
                  if (this.serverPort == 443)
                      return true;
                  // else false
              } else {
                  if (this.serverPort == 80)
                      return true;
                  // else false;
              }
          } else if (portAudience.startsWith(":")) {
              // has a port
              String portStr = ":" + this.serverPort; // such as: ":8020"
              if (portAudience.startsWith(portStr)) {
                  if (portAudience.length() > portStr.length()) {
                      char slash = portAudience.charAt(portStr.length());
                      return slash == '/'; // return ending with '/'
                  } else { // exact match
                      return true;
                  }
              } // else false
          }
  
          return false;
      }
docs: {@inheritDoc}