code: public static Http2Headers toHttp2Headers(HttpMessage in, boolean validateHeaders) {
          HttpHeaders inHeaders = in.headers();
          final Http2Headers out = new DefaultHttp2Headers(validateHeaders, inHeaders.size());
          if (in instanceof HttpRequest) {
              HttpRequest request = (HttpRequest) in;
              URI requestTargetUri = URI.create(request.uri());
              out.path(toHttp2Path(requestTargetUri));
              out.method(request.method().asciiName());
              setHttp2Scheme(inHeaders, requestTargetUri, out);
  
              if (!isOriginForm(requestTargetUri) && !isAsteriskForm(requestTargetUri)) {
                  // Attempt to take from HOST header before taking from the request-line
                  String host = inHeaders.getAsString(HttpHeaderNames.HOST);
                  setHttp2Authority((host == null || host.isEmpty()) ? requestTargetUri.getAuthority() : host, out);
              }
          } else if (in instanceof HttpResponse) {
              HttpResponse response = (HttpResponse) in;
              out.status(response.status().codeAsText());
          }
  
          // Add the HTTP headers which have not been consumed above
          toHttp2Headers(inHeaders, out);
          return out;
      }
docs: Converts the given HTTP/1.x headers into HTTP/2 headers.
  The following headers are only used if they can not be found in from the {@code HOST} header or the
  {@code Request-Line} as defined by <a href="https://tools.ietf.org/html/rfc7230">rfc7230</a>
  <ul>
  <li>{@link ExtensionHeaderNames#SCHEME}</li>
  </ul>
  {@link ExtensionHeaderNames#PATH} is ignored and instead extracted from the {@code Request-Line}.