@Override
        protected void sanitizeHeadersBeforeEncode(HttpResponse msg, boolean isAlwaysEmpty) {
            if (!isAlwaysEmpty && HttpMethod.CONNECT.equals(method) &&
                msg.status().codeClass() == HttpStatusClass.SUCCESS) {
                // Stripping Transfer-Encoding:
                // See section 3.3.1 of https://datatracker.ietf.org/doc/rfc7230
                msg.headers().remove(HttpHeaderNames.TRANSFER_ENCODING);
                return;
            }

            super.sanitizeHeadersBeforeEncode(msg, isAlwaysEmpty);
        }
Upgrades to another protocol from HTTP. Removes the {@link HttpRequestDecoder} and
{@link HttpResponseEncoder} from the pipeline.
core/src/main/java/com/linecorp/armeria/server/HttpServerCodec.java