Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http_client: Fixed bug, so user-agent header now is added to HTTP request #674

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions modules/http_client/functions.c
Expand Up @@ -54,6 +54,7 @@ typedef struct {
char *ciphersuites;
char *http_proxy;
char *failovercon;
char *useragent;
unsigned int authmethod;
unsigned int http_proxy_port;
unsigned int tlsversion;
Expand Down Expand Up @@ -228,6 +229,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 */
Expand Down Expand Up @@ -583,6 +585,7 @@ int http_query(struct sip_msg* _m, char* _url, str* _dst, char* _post)
query_params.verify_peer = default_tls_verify_peer;
query_params.verify_host = default_tls_verify_host;
query_params.timeout = default_connection_timeout;
query_params.useragent = as_asciiz(&default_useragent);
query_params.http_follow_redirect = default_http_follow_redirect;
query_params.oneline = 1;
query_params.maxdatasize = 0;
Expand Down