summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/abrt_curl.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/abrt_curl.c b/src/lib/abrt_curl.c
index 74aae062..a17f14d2 100644
--- a/src/lib/abrt_curl.c
+++ b/src/lib/abrt_curl.c
@@ -287,8 +287,10 @@ abrt_post(abrt_post_state_t *state,
// truncates data_size on 32-bit arch. Need xcurl_easy_setopt_long_long()?
// Also, I'm not sure CURLOPT_POSTFIELDSIZE_LARGE special-cases -1.
}
- // Override "Content-Type:"
+
struct curl_slist *httpheader_list = NULL;
+
+ // Override "Content-Type:"
if (data_size != ABRT_POST_DATA_FROMFILE_AS_FORM_DATA)
{
char *content_type_header = xasprintf("Content-Type: %s", content_type);
@@ -300,6 +302,12 @@ abrt_post(abrt_post_state_t *state,
xcurl_easy_setopt_ptr(handle, CURLOPT_HTTPHEADER, httpheader_list);
}
+ // Override "Accept: text/plain": helps convince server to send plain-text
+ // error messages in the body of HTTP error responses [not verified to work]
+ httpheader_list = curl_slist_append(httpheader_list, "Accept: text/plain");
+ if (!httpheader_list)
+ error_msg_and_die("out of memory");
+
// Disabled: was observed to also handle "305 Use proxy" redirect,
// apparently with POST->GET remapping - which server didn't like at all.
// Attempted to suppress remapping on 305 using CURLOPT_POSTREDIR of -1,