http_client assumes request payload is non-binary #24431
Labels
area: Networking
bug
The issue is a bug, or the PR is fixing a bug
priority: medium
Medium impact/importance bug
http_client.c
usesstrlen
(inhttp_send_data
) to calculate requestpayload
size, instead of usingpayload_len
that is provided by the user. This is incorrect and results in writing fewer bytes than is expected by the server whenpayload
is binary.An additional issue is that when
payload_cb
is used by the user to provide data via callback, noContent-Length
is sent byhttp_client
event ifpayload_len
is provided. By the timepayload_cb
is invoked to provide the data the request headers have already been sent.The text was updated successfully, but these errors were encountered: