From 9456bd7e4d110dcecc0eaf156aae023bd1928246 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sat, 1 Jul 2023 15:25:34 -0700 Subject: [PATCH] client: set Content-type of POST requests to text/xml. Otherwise some RPC-handling frameworks complain. --- client/http_curl.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client/http_curl.cpp b/client/http_curl.cpp index e3bc770d8e..96a8228c61 100644 --- a/client/http_curl.cpp +++ b/client/http_curl.cpp @@ -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, @@ -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)) {