code: private boolean isForGerritHost(HttpRequest request) {
          if (!(request instanceof HttpRequestWrapper)) return false;
          HttpRequest originalRequest = ((HttpRequestWrapper) request).getOriginal();
          if (!(originalRequest instanceof HttpRequestBase)) return false;
          URI uri = ((HttpRequestBase) originalRequest).getURI();
          URI authDataUri = URI.create(authData.getHost());
          if (uri == null || uri.getHost() == null) return false;
          boolean hostEquals = uri.getHost().equals(authDataUri.getHost());
          boolean portEquals = uri.getPort() == authDataUri.getPort();
          return hostEquals && portEquals;
      }
docs: Checks if request is intended for Gerrit host.