diff options
author | Ross Burton <ross@linux.intel.com> | 2009-02-10 12:35:43 +0000 |
---|---|---|
committer | Ross Burton <ross@linux.intel.com> | 2009-02-10 12:35:43 +0000 |
commit | 174dc7f5743a505da96def0f62590ed81e34025b (patch) | |
tree | 34212cadbc9e39a7b049b3021548b23ebfe86947 | |
parent | 5946fdcdabd10b8568a79896a695f8b43836c8db (diff) | |
download | librest-174dc7f5743a505da96def0f62590ed81e34025b.tar.gz |
Set the user agent on the proxy call
-rw-r--r-- | rest/rest-proxy-call.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/rest/rest-proxy-call.c b/rest/rest-proxy-call.c index e257335..772c13b 100644 --- a/rest/rest-proxy-call.c +++ b/rest/rest-proxy-call.c @@ -584,7 +584,7 @@ rest_proxy_call_async (RestProxyCall *call, RestProxyCallPrivate *priv; RestProxyCallClass *call_class; const gchar *bound_url; - gchar *url = NULL; + gchar *url = NULL, *user_agent = NULL; SoupMessage *message; RestProxyCallAsyncClosure *closure; GError *error = NULL; @@ -638,6 +638,12 @@ rest_proxy_call_async (RestProxyCall *call, url, priv->params); + /* Set the user agent, if one was set in the proxy */ + g_object_get (priv->proxy, "user-agent", &user_agent, NULL); + if (user_agent) { + soup_message_headers_append (message->request_headers, "User-Agent", user_agent); + } + closure = g_slice_new0 (RestProxyCallAsyncClosure); closure->call = g_object_ref (call); closure->callback = callback; |