summaryrefslogtreecommitdiffstats
path: root/src/lib/abrt_curl.c
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2011-04-08 18:12:29 +0200
committerDenys Vlasenko <dvlasenk@redhat.com>2011-04-08 18:12:29 +0200
commit286e6f36c69f428a32568a611c6c44e01c7b9be5 (patch)
treefc0354f5735ce0ea52ccee97f1ccba1fdb472283 /src/lib/abrt_curl.c
parent62919cfbd5ed0d3a19ca96ccb6508db1bae2f8d8 (diff)
downloadabrt-286e6f36c69f428a32568a611c6c44e01c7b9be5.tar.gz
abrt-286e6f36c69f428a32568a611c6c44e01c7b9be5.tar.xz
abrt-286e6f36c69f428a32568a611c6c44e01c7b9be5.zip
send "User-Agent: ABRT/n.n.n" header in RHTS http transactions
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'src/lib/abrt_curl.c')
-rw-r--r--src/lib/abrt_curl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/abrt_curl.c b/src/lib/abrt_curl.c
index a17f14d2..1cb9391d 100644
--- a/src/lib/abrt_curl.c
+++ b/src/lib/abrt_curl.c
@@ -308,6 +308,11 @@ abrt_post(abrt_post_state_t *state,
if (!httpheader_list)
error_msg_and_die("out of memory");
+ // Add User-Agent: ABRT/N.M
+ httpheader_list = curl_slist_append(httpheader_list, "User-Agent: ABRT/"VERSION);
+ 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,