return h;
}
+static bool is_upload_request(const char *method)
+{
+ if (method == nullptr) {
+ return false;
+ }
+ return strcmp(method, "POST") == 0 || strcmp(method, "PUT") == 0;
+}
+
/*
* process a single simple one off request, not going through RGWHTTPManager. Not using
* req_data.
}
curl_easy_setopt(curl_handle, CURLOPT_READFUNCTION, simple_send_http_data);
curl_easy_setopt(curl_handle, CURLOPT_READDATA, (void *)this);
- curl_easy_setopt(curl_handle, CURLOPT_UPLOAD, 1L);
+ if (is_upload_request(method)) {
+ curl_easy_setopt(curl_handle, CURLOPT_UPLOAD, 1L);
+ }
if (has_send_len) {
curl_easy_setopt(curl_handle, CURLOPT_INFILESIZE, (void *)send_len);
}
}
curl_easy_setopt(easy_handle, CURLOPT_READFUNCTION, send_http_data);
curl_easy_setopt(easy_handle, CURLOPT_READDATA, (void *)req_data);
- curl_easy_setopt(easy_handle, CURLOPT_UPLOAD, 1L);
+ if (is_upload_request(method)) {
+ curl_easy_setopt(easy_handle, CURLOPT_UPLOAD, 1L);
+ }
if (has_send_len) {
curl_easy_setopt(easy_handle, CURLOPT_INFILESIZE, (void *)send_len);
}