mirror of
https://github.com/haproxy/haproxy.git
synced 2026-07-15 20:03:33 -04:00
BUG/MINOR: httpclient: don't send an empty body
Forbid the httpclient to send an empty chunked client when there is no data to send. It does happen when doing a simple GET too. Must be backported in 2.5.
This commit is contained in:
parent
b9e3fb7315
commit
e1e045f4d7
1 changed files with 4 additions and 0 deletions
|
|
@ -278,6 +278,10 @@ int httpclient_req_gen(struct httpclient *hc, const struct ist url, enum http_me
|
|||
htx = htx_from_buf(&hc->req.buf);
|
||||
if (!htx)
|
||||
goto error;
|
||||
|
||||
if (!hc->ops.req_payload && !isttest(payload))
|
||||
flags |= HTX_SL_F_BODYLESS;
|
||||
|
||||
sl = htx_add_stline(htx, HTX_BLK_REQ_SL, flags, meth_ist, url, vsn);
|
||||
if (!sl) {
|
||||
goto error;
|
||||
|
|
|
|||
Loading…
Reference in a new issue