[sr-dev] [kamailio/kamailio] http_client: Fixed bug, so user-agent header now is added to HTTP request (#674)

Jurijs Ivolga notifications at github.com
Fri Jun 17 11:37:06 CEST 2016


@@ -56,6 +56,7 @@ typedef struct {
     char *cacert;
     char *ciphersuites;
     char *http_proxy;
+    char *useragent;
     unsigned int authmethod;
     unsigned int http_proxy_port;
     unsigned int tlsversion;
@@ -206,6 +207,7 @@ static int curL_query_url(struct sip_msg* _m, const char* _url, str* _dst, const
     res |= curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_function);
     res |= curl_easy_setopt(curl, CURLOPT_WRITEDATA, &stream);

+    res |= curl_easy_setopt(curl, CURLOPT_USERAGENT, params->useragent);

     if (res != CURLE_OK) {
        /* PANIC */
@@ -379,6 +381,7 @@ int curl_con_query_url(struct sip_msg* _m, const str *connection, const str* url
        query_params.cacert = default_tls_cacert;
        query_params.ciphersuites = conn->ciphersuites;
        query_params.tlsversion = conn->tlsversion;
+        query_params.useragent = conn->useragent;
        query_params.verify_peer = conn->verify_peer;
        query_params.verify_host = conn->verify_host;
        query_params.timeout = conn->timeout;

This code make  http_connect to send user_agent. Not sure if this is correct. :)

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/674#issuecomment-226725634
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20160617/b93006ac/attachment.html>


More information about the sr-dev mailing list