diff --git a/src/proxy.c b/src/proxy.c index 838722d1e..a5570dafa 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -1477,6 +1477,14 @@ int stream_set_backend(struct stream *s, struct proxy *be) s->flags |= SF_HTX; } } + else if (IS_HTX_STRM(s) && be->mode != PR_MODE_HTTP) { + /* If a TCP backend is assgiend to an HTX stream, return + * an error. It may happens for a new stream on a + * previously upgraded connnections. */ + if (!(s->flags & SF_ERR_MASK)) + s->flags |= SF_ERR_INTERNAL; + return 0; + } /* we may request to parse a request body */ if (be->options & PR_O_WREQ_BODY)