mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-11 17:46:57 +02:00
BUG/MEDIUM: proto_htx: Don't add EOM on 1xx informational messages
Since the commit b75b5eaf
("MEDIUM: htx: 1xx messages are now part of the final
reponses"), these messages are part of the response and should not contain
EOM. This block is skipped during responses parsing, but analyzers still add it
for "100-Continue" and "103-Eraly-Hints". It can also be added for error files
with 1xx status code.
Now, when HAProxy generate such transitional responses, it does not emit EOM
blocks. And informational messages are now forbidden in error files.
This patch must be backported to 2.0.
This commit is contained in:
parent
2164800c1b
commit
1d5ec0944f
@ -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')))
|
((*(h1sl.st.v.ptr + 5) == '1') && (*(h1sl.st.v.ptr + 7) >= '1')))
|
||||||
h1m.flags |= H1_MF_VER_11;
|
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)
|
if (h1m.flags & H1_MF_VER_11)
|
||||||
flags |= HTX_SL_F_VER_11;
|
flags |= HTX_SL_F_VER_11;
|
||||||
if (h1m.flags & H1_MF_XFER_ENC)
|
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;
|
goto error;
|
||||||
ret += sent;
|
ret += sent;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!htx_add_endof(htx, HTX_BLK_EOM))
|
if (!htx_add_endof(htx, HTX_BLK_EOM))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
return htx;
|
return htx;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
|
@ -2650,7 +2650,7 @@ static int htx_reply_103_early_hints(struct channel *res)
|
|||||||
struct htx *htx = htx_from_buf(&res->buf);
|
struct htx *htx = htx_from_buf(&res->buf);
|
||||||
size_t data;
|
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,
|
/* If an error occurred during an Early-hint rule,
|
||||||
* remove the incomplete HTTP 103 response from the
|
* remove the incomplete HTTP 103 response from the
|
||||||
* buffer */
|
* buffer */
|
||||||
@ -5443,7 +5443,7 @@ static int htx_reply_100_continue(struct stream *s)
|
|||||||
goto fail;
|
goto fail;
|
||||||
sl->info.res.status = 100;
|
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;
|
goto fail;
|
||||||
|
|
||||||
data = htx->data - co_data(res);
|
data = htx->data - co_data(res);
|
||||||
|
Loading…
Reference in New Issue
Block a user