Skip to content

Commit

Permalink
Disable setting "Expect 100" in request header when request data size…
Browse files Browse the repository at this point in the history
… is larger than 1024 bytes (#264)

Curl automatically sets it when the request is a POST and the data size is larger than 1024 bytes.
Requests with the Expect: 100-Continue header have an increased probability of becoming separated from one another,
and hence returning with an error.
It can be disabled via setting the Expect: header to the empty string.

Signed-off-by: Shrikant Temburwar <[email protected]>
  • Loading branch information
shrikant1407 authored Nov 24, 2023
1 parent 809bef4 commit 4de26a7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions network/network_if_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,10 @@ int32_t fdo_con_send_recv_message(uint32_t protocol_version,
goto err;
}

if (length > REST_MAX_MSGHDR_SIZE) {
msg_header = curl_slist_append(msg_header, "Expect:");
}

curlCode = curl_easy_setopt(curl, CURLOPT_CONNECT_ONLY, 0L);
if (curlCode != CURLE_OK) {
LOG(LOG_ERROR, "CURL_ERROR: Could not disable connect only.\n");
Expand Down

0 comments on commit 4de26a7

Please sign in to comment.