code: private static boolean isUpgradeRequest(HttpObject msg) {
          return msg instanceof HttpRequest && ((HttpRequest) msg).headers().get(HttpHeaderNames.UPGRADE) != null;
      }
docs: Determines whether or not the message is an HTTP upgrade request.