code: @Override
      public boolean isH2Request(HttpInboundConnection hic, ServletRequest request) throws ServletException {
          
          //first check if H2 is enabled for this channel/port
          if (!((Http2InboundConnection)hic).isHTTP2UpgradeRequest(null, true) ){
              return false;
          }
          
          Map<String, String> headers = new HashMap<String, String>();
          HttpServletRequest hsrt = (HttpServletRequest) request;
          Enumeration<String> headerNames = hsrt.getHeaderNames();
          
          // create a map of the headers to pass to the transport code
          while (headerNames.hasMoreElements()) {
              String key = (String) headerNames.nextElement();
              String value = hsrt.getHeader(key);
              headers.put(key, value);
          }
          //check if this request is asking to do H2
          return ((Http2InboundConnection)hic).isHTTP2UpgradeRequest(headers, false);
      }
docs: Determines if a given request is an http2 upgrade request