summaryrefslogtreecommitdiff
path: root/methods/http.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2012-01-31 11:21:02 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2012-01-31 11:21:02 +0100
commitc7ed2c0e34546e12a035e4c4c2f034a6ee765748 (patch)
treedcfd5eb735b8ea547142be68f993a3f555ecb0b0 /methods/http.cc
parent3102af74e7ffaab3f47741c05451ce7f0e3b38fe (diff)
parentb9ed63d39e8771f42ec74e3ad401b7c1e846b206 (diff)
merged from lp:~donkult/apt/experimental/
Diffstat (limited to 'methods/http.cc')
-rw-r--r--methods/http.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/methods/http.cc b/methods/http.cc
index b8ed43cd2..2721b1224 100644
--- a/methods/http.cc
+++ b/methods/http.cc
@@ -716,7 +716,19 @@ void HttpMethod::SendReq(FetchItem *Itm,CircleBuf &Out)
}
}
-
+ // If we ask for uncompressed files servers might respond with content-
+ // negotation which lets us end up with compressed files we do not support,
+ // see 657029, 657560 and co, so if we have no extension on the request
+ // ask for text only. As a sidenote: If there is nothing to negotate servers
+ // seem to be nice and ignore it.
+ if (_config->FindB("Acquire::http::SendAccept", true) == true)
+ {
+ size_t const filepos = Itm->Uri.find_last_of('/');
+ string const file = Itm->Uri.substr(filepos + 1);
+ if (flExtension(file) == file)
+ strcat(Buf,"Accept: text/*\r\n");
+ }
+
string Req = Buf;
// Check for a partial file