Skip to content

Commit

Permalink
rest_client: Fix a rest_post() regression bug
Browse files Browse the repository at this point in the history
Commit c549e6e added an unnecessary libcurl option which caused
the HTTP headers to be logged into the output body pseudo-variable
alongside the request body when performing a rest_post().

This patch disables the above-mentioned libcurl option (CURLOPT_HEADER).

Reported by @goharahmed on GitHub.
Fixes #1247.

(cherry picked from commit 91d7e7f)
  • Loading branch information
liviuchircu committed Jan 5, 2018
1 parent 4f35c99 commit aa81c67
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions modules/rest_client/rest_methods.c
Expand Up @@ -847,12 +847,9 @@ int rest_post_method(struct sip_msg *msg, char *url, char *body, char *ctype,
w_curl_easy_setopt(sync_handle, CURLOPT_STDERR, stdout);
w_curl_easy_setopt(sync_handle, CURLOPT_FAILONERROR, 0);

w_curl_easy_setopt(sync_handle, CURLOPT_HEADER, 1L);
w_curl_easy_setopt(sync_handle, CURLOPT_WRITEFUNCTION, write_func);
w_curl_easy_setopt(sync_handle, CURLOPT_WRITEDATA, &res_body);



w_curl_easy_setopt(sync_handle, CURLOPT_HEADERFUNCTION, header_func);
w_curl_easy_setopt(sync_handle, CURLOPT_HEADERDATA, &st);

Expand Down

0 comments on commit aa81c67

Please sign in to comment.