Skip to content

Commit

Permalink
client: set Content-type of POST requests to text/xml.
Browse files Browse the repository at this point in the history
Otherwise some RPC-handling frameworks complain.
  • Loading branch information
davidpanderson committed Jul 1, 2023
1 parent 857b0a7 commit 9456bd7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions client/http_curl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,8 @@ static int set_cloexec(void*, curl_socket_t fd, curlsocktype purpose) {
int HTTP_OP::libcurl_exec(
const char* url, const char* in, const char* out, double offset,
#ifdef _WIN32
// expected size of file we're downloading.
// on Win, pre-allocate this file to reduce disk fragmentation
double size,
#else
double,
Expand Down Expand Up @@ -559,6 +561,12 @@ int HTTP_OP::libcurl_exec(
pcurlList = curl_slist_append(pcurlList, buf);
}

// if this is a post, set content type (always text/xml)
//
if (is_post) {
pcurlList = curl_slist_append(pcurlList, "Content-type: text/xml");
}

// set up an output file for the reply
//
if (strlen(outfile)) {
Expand Down

0 comments on commit 9456bd7

Please sign in to comment.