b412637a8f5a486232200975695a9b42da5ff582
1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## curl-followlocation.dpatch by Florian Forster <octo@verplant.org>
3 ##
4 ## DP: Plugins using libcurl: Enable the ‘CURLOPT_FOLLOWLOCATION’ option.
6 @DPATCH@
8 diff a/src/apache.c b/src/apache.c
9 --- a/src/apache.c
10 +++ b/src/apache.c
11 @@ -458,6 +458,7 @@ static int init_host (apache_t *st) /* {{{ */
12 }
14 curl_easy_setopt (st->curl, CURLOPT_URL, st->url);
15 + curl_easy_setopt (st->curl, CURLOPT_FOLLOWLOCATION, 1);
17 if (st->verify_peer != 0)
18 {
19 diff a/src/ascent.c b/src/ascent.c
20 --- a/src/ascent.c
21 +++ b/src/ascent.c
22 @@ -560,6 +560,7 @@ static int ascent_init (void) /* {{{ */
23 }
25 curl_easy_setopt (curl, CURLOPT_URL, url);
26 + curl_easy_setopt (curl, CURLOPT_FOLLOWLOCATION, 1);
28 if ((verify_peer == NULL) || (strcmp (verify_peer, "true") == 0))
29 curl_easy_setopt (curl, CURLOPT_SSL_VERIFYPEER, 1);
30 diff a/src/bind.c b/src/bind.c
31 --- a/src/bind.c
32 +++ b/src/bind.c
33 @@ -1395,6 +1395,7 @@ static int bind_init (void) /* {{{ */
34 curl_easy_setopt (curl, CURLOPT_USERAGENT, PACKAGE_NAME"/"PACKAGE_VERSION);
35 curl_easy_setopt (curl, CURLOPT_ERRORBUFFER, bind_curl_error);
36 curl_easy_setopt (curl, CURLOPT_URL, (url != NULL) ? url : BIND_DEFAULT_URL);
37 + curl_easy_setopt (curl, CURLOPT_FOLLOWLOCATION, 1);
39 return (0);
40 } /* }}} int bind_init */
41 diff a/src/curl.c b/src/curl.c
42 --- a/src/curl.c
43 +++ b/src/curl.c
44 @@ -346,6 +346,7 @@ static int cc_page_init_curl (web_page_t *wp) /* {{{ */
45 PACKAGE_NAME"/"PACKAGE_VERSION);
46 curl_easy_setopt (wp->curl, CURLOPT_ERRORBUFFER, wp->curl_errbuf);
47 curl_easy_setopt (wp->curl, CURLOPT_URL, wp->url);
48 + curl_easy_setopt (wp->curl, CURLOPT_FOLLOWLOCATION, 1);
50 if (wp->user != NULL)
51 {
52 diff a/src/nginx.c b/src/nginx.c
53 --- a/src/nginx.c
54 +++ b/src/nginx.c
55 @@ -141,6 +141,8 @@ static int init (void)
56 curl_easy_setopt (curl, CURLOPT_URL, url);
57 }
59 + curl_easy_setopt (curl, CURLOPT_FOLLOWLOCATION, 1);
60 +
61 if ((verify_peer == NULL) || (strcmp (verify_peer, "true") == 0))
62 {
63 curl_easy_setopt (curl, CURLOPT_SSL_VERIFYPEER, 1);