netifi-httpgateway/src/main/java/com/netifi/httpgateway/bridge/codec/HttpObjectDecoder.java
/**
   * Returns true if the server switched to a different protocol than HTTP/1.0 or HTTP/1.1, e.g.
   * HTTP/2 or Websocket. Returns false if the upgrade happened in a different layer, e.g. upgrade
   * from HTTP/1.1 to HTTP/1.1 over TLS.
   */
Returns true if the server switched to a different protocol than HTTP/1.0 or HTTP/1.1, e.g.
HTTP/2 or Websocket. Returns false if the upgrade happened in a different layer, e.g.
Returns true if the server switched to a different protocol than HTTP / 1 . 0 or HTTP / 1 . 1 e . g . HTTP / 2 or Websocket . Returns false if the upgrade happened in a different layer e . g .
protected boolean isSwitchingToNonHttp1Protocol(HttpResponse msg) {
    if (msg.status().code() != HttpResponseStatus.SWITCHING_PROTOCOLS.code()) {
      return false;
    }
    String newProtocol = msg.headers().get(HttpHeaderNames.UPGRADE);
    return newProtocol == null
        || !newProtocol.contains(HttpVersion.HTTP_1_0.text())
            && !newProtocol.contains(HttpVersion.HTTP_1_1.text());
  }
protected boolean isSwitchingToNonHttp1Protocol ( HttpResponse msg ) { if ( msg . status ( ) . code ( ) != HttpResponseStatus . SWITCHING_PROTOCOLS . code ( ) ) { return false ; } String newProtocol = msg . headers ( ) . get ( HttpHeaderNames . UPGRADE ) ; return newProtocol == null || ! newProtocol . contains ( HttpVersion . HTTP_1_0 . text ( ) ) && ! newProtocol . contains ( HttpVersion . HTTP_1_1 . text ( ) ) ; }
Returns true if the server switched to a different protocol than HTTP/1.0 or HTTP/1.1, e.g.
Returns true if the server switched to a different protocol than HTTP / 1 . 0 or HTTP / 1 . 1 e . g .