diff --git a/src/h2.c b/src/h2.c index 6a1debf95..d7031c75d 100644 --- a/src/h2.c +++ b/src/h2.c @@ -684,6 +684,9 @@ int h2_make_htx_request(struct http_hdr *list, struct htx *htx, unsigned int *ms goto fail; } + if (!(*msgf & H2_MSGF_BODY) || ((*msgf & H2_MSGF_BODY_CL) && *body_len == 0)) + sl_flags |= HTX_SL_F_BODYLESS; + /* update the start line with last detected header info */ sl->flags |= sl_flags; @@ -890,6 +893,9 @@ int h2_make_htx_response(struct http_hdr *list, struct htx *htx, unsigned int *m goto fail; } + if (!(*msgf & H2_MSGF_BODY) || ((*msgf & H2_MSGF_BODY_CL) && *body_len == 0)) + sl_flags |= HTX_SL_F_BODYLESS; + /* update the start line with last detected header info */ sl->flags |= sl_flags;