diff --git a/src/http_htx.c b/src/http_htx.c index bc26e5ba4..cd19d8f8b 100644 --- a/src/http_htx.c +++ b/src/http_htx.c @@ -629,6 +629,9 @@ static struct htx *http_str_to_htx(struct buffer *buf, struct ist raw) ((*(h1sl.st.v.ptr + 5) == '1') && (*(h1sl.st.v.ptr + 7) >= '1'))) h1m.flags |= H1_MF_VER_11; + if (h1sl.st.status < 200 && (h1sl.st.status == 100 || h1sl.st.status >= 102)) + goto error; + if (h1m.flags & H1_MF_VER_11) flags |= HTX_SL_F_VER_11; if (h1m.flags & H1_MF_XFER_ENC) @@ -656,8 +659,10 @@ static struct htx *http_str_to_htx(struct buffer *buf, struct ist raw) goto error; ret += sent; } + if (!htx_add_endof(htx, HTX_BLK_EOM)) goto error; + return htx; error: diff --git a/src/proto_htx.c b/src/proto_htx.c index d821e38cc..6cbd33b9b 100644 --- a/src/proto_htx.c +++ b/src/proto_htx.c @@ -2650,7 +2650,7 @@ static int htx_reply_103_early_hints(struct channel *res) struct htx *htx = htx_from_buf(&res->buf); size_t data; - if (!htx_add_endof(htx, HTX_BLK_EOH) || !htx_add_endof(htx, HTX_BLK_EOM)) { + if (!htx_add_endof(htx, HTX_BLK_EOH)) { /* If an error occurred during an Early-hint rule, * remove the incomplete HTTP 103 response from the * buffer */ @@ -5443,7 +5443,7 @@ static int htx_reply_100_continue(struct stream *s) goto fail; sl->info.res.status = 100; - if (!htx_add_endof(htx, HTX_BLK_EOH) || !htx_add_endof(htx, HTX_BLK_EOM)) + if (!htx_add_endof(htx, HTX_BLK_EOH)) goto fail; data = htx->data - co_data(res);