diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2005-05-19 08:26:28 +0000 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2005-05-19 08:26:28 +0000 |
commit | 106e674096a2c6da1e3fa44b88ec228a61ef7dfe (patch) | |
tree | a83ff4b4a5f520355d0ceaef5776c2a369a551c2 /methods/http.cc | |
parent | f2152f036e11c633b54a9146665a47f7b980a355 (diff) |
* fix the cache-control header generation
* methods/http.cc:
a cache cache header can now be generated even if no proxy is
specified to support "no-cache" for transparent proxies
Diffstat (limited to 'methods/http.cc')
-rw-r--r-- | methods/http.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/methods/http.cc b/methods/http.cc index 81a64d7a3..ba86aa6b6 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -635,9 +635,9 @@ void HttpMethod::SendReq(FetchItem *Itm,CircleBuf &Out) and a no-store directive for archives. */ sprintf(Buf,"GET %s HTTP/1.1\r\nHost: %s\r\n", Itm->Uri.c_str(),ProperHost.c_str()); - if (_config->FindB("Acquire::http::No-Cache",false) == true) - strcat(Buf,"Cache-Control: no-cache\r\nPragma: no-cache\r\n"); - else + // only generate a cache control header if we actually want to + // use a cache + if (_config->FindB("Acquire::http::No-Cache",false) == false) { if (Itm->IndexFile == true) sprintf(Buf+strlen(Buf),"Cache-Control: max-age=%u\r\n", @@ -649,6 +649,10 @@ void HttpMethod::SendReq(FetchItem *Itm,CircleBuf &Out) } } } + // generate a no-cache header if needed + if (_config->FindB("Acquire::http::No-Cache",false) == true) + strcat(Buf,"Cache-Control: no-cache\r\nPragma: no-cache\r\n"); + string Req = Buf; |