summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2009-02-03 14:10:36 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2009-02-03 14:10:36 +0100
commit668ce84da00041c65cae3957d2b49786efa34276 (patch)
tree21c1336b504b4e077187252af02a640b48ba21f5
parentd24ddc3008473562ca6dc8d9e6a2f2b790fbe5ce (diff)
* methods/https.cc:
- add Acquire::https::AllowRedirect support
-rw-r--r--debian/changelog2
-rw-r--r--doc/examples/configure-index6
-rw-r--r--methods/https.cc5
3 files changed, 11 insertions, 2 deletions
diff --git a/debian/changelog b/debian/changelog
index 6dea85f25..c0da66973 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -41,6 +41,8 @@ apt (0.7.21) UNRELEASED; urgency=low
* apt-pkg/pkgcache.cc:
- do not run "dpkg --configure pkg" if pkg is in trigger-awaited
state (LP: #322955)
+ * methods/https.cc:
+ - add Acquire::https::AllowRedirect support
[ Dereck Wonnacott ]
* apt-ftparchive might write corrupt Release files (LP: #46439)
diff --git a/doc/examples/configure-index b/doc/examples/configure-index
index 84b1d8829..a4167085b 100644
--- a/doc/examples/configure-index
+++ b/doc/examples/configure-index
@@ -183,7 +183,8 @@ Acquire
Proxy::http.us.debian.org "DIRECT"; // Specific per-host setting
Timeout "120";
Pipeline-Depth "5";
-
+ AllowRedirect "true";
+
// Cache Control. Note these do not work with Squid 2.0.2
No-Cache "false";
Max-Age "86400"; // 1 Day age on index files
@@ -200,7 +201,8 @@ Acquire
Verify-Peer "false";
SslCert "/etc/apt/some.pem";
CaPath "/etc/ssl/certs";
- Verify-Host" "2";
+ Verify-Host" "true";
+ AllowRedirect "true";
};
ftp
diff --git a/methods/https.cc b/methods/https.cc
index 7c743a424..8bf44b52a 100644
--- a/methods/https.cc
+++ b/methods/https.cc
@@ -208,6 +208,11 @@ bool HttpsMethod::Fetch(FetchItem *Itm)
curl_easy_setopt(curl, CURLOPT_TIMEOUT, timeout);
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, timeout);
+ // set redirect options and default to 10 redirects
+ bool AllowRedirect = _config->FindI("Acquire::https::AllowRedirect", true);
+ curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, AllowRedirect);
+ curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 10);
+
// debug
if(_config->FindB("Debug::Acquire::https", false))
curl_easy_setopt(curl, CURLOPT_VERBOSE, true);