]> sjero.net Git - wget/commitdiff
Use Cache-Control when --no-cache is specified.
authorGiuseppe Scrivano <gscrivano@gnu.org>
Sat, 6 Aug 2011 08:56:07 +0000 (10:56 +0200)
committerGiuseppe Scrivano <gscrivano@gnu.org>
Sat, 6 Aug 2011 08:56:07 +0000 (10:56 +0200)
src/ChangeLog
src/http.c

index b50e33f60debe1e000743ae73a35842836ccb79c..b998e98fe5de8c2267b7565e971e01c9114d35eb 100644 (file)
@@ -1,7 +1,13 @@
+2011-08-06  Giuseppe Scrivano  <gscrivano@gnu.org>
+
+       * http.c (gethttp): Add the Cache-Control HTTP header when --no-cache
+       is specified.
+       Reported by: Коренберг Марк <socketpair@gmail.com>.
+
 2011-08-05  Giuseppe Scrivano  <gscrivano@gnu.org>
 
-       * utils.c (acceptable): Accept the file if it is the specified output
-       destination.
+       * utils.c (acceptable): Accept always the file if it is the specified
+       output destination.
        Reported by: Shai Berger <shai@platonix.com>
 
 2011-08-05  Giuseppe Scrivano  <giuseppe@southpole.se>
 
        * cookies.c (parse_set_cookie): If the value is quoted, do not modify
        it.
-       Reported by: Nirgal Vourgère <jmv_deb@nirgal.com>
+       Reported by: Nirgal Vourgère <jmv_deb@nirgal.com>
 
 2011-07-29  Giuseppe Scrivano  <giuseppe@southpole.se>
 
        * log.c (logprintf): Exit immediately on a SIGPIPE error.
-       Reported by: Noèl Köthe  <noel@debian.org>.
+       Reported by: Noèl Köthe  <noel@debian.org>.
 
-2011-07-26  Carlos Martín Nieto  <carlos@cmartin.tk>  (tiny change)
+2011-07-26  Carlos Martín Nieto  <carlos@cmartin.tk>  (tiny change)
 
        * init.c (home_dir): Allocate path buffer dinamically.
 
        SSL_pending.
        (openssl_peek): Make the call non-blocking.
 
-2011-04-11  Cristian Rodríguez  <crrodriguez@opensuse.org> (tiny change)
+2011-04-11  Cristian Rodríguez  <crrodriguez@opensuse.org> (tiny change)
 
        * openssl.c (ssl_init) [! OPENSSL_NO_SSL2]: Use SSLv2 only when
        available.
 
        * html-url.c, http.c: Avoid casts in a couple spots.
 
-2008-05-30 Henri Häkkinen  <henux@users.sourceforge.net>
+2008-05-30 Henri Häkkinen  <henux@users.sourceforge.net>
 
        * cookies.c, ftp-basic.c, hash.c, html-url.c, http-ntlm.c, http.c,
        init.c, log.c, main.c, progress.c, ptimer.c, spider.c, url.c,
 
 2001-02-16  Dan Harkless  <wget@harkless.org>
 
-       * init.c (commands): Hack Kampbjørn <hack@hackdata.com> discovered
+       * init.c (commands): Hack Kampbjørn <hack@hackdata.com> discovered
        that "httpsproxy" had been inserted into commands[] out of
        alphabetical order, causing "BUG: unknown command `httpuser'".
 
        characters.
        (skip_uname): Ditto.
 
-2001-02-11  Hack Kampbjørn  <hack@hackdata.com>
+2001-02-11  Hack Kampbjørn  <hack@hackdata.com>
 
        * url.c (parseurl): Debug-print u->ftp_type.
 
 
 2000-12-30  Dan Harkless  <wget@harkless.org>
 
-       * ftp.c, http.c:  Applied Hack Kampbjørn <hack@hackdata.com>'s
+       * ftp.c, http.c:  Applied Hack Kampbjørn <hack@hackdata.com>'s
        patch to deal with h_errno not being defined in netdb.h under Cygwin.
 
 2000-12-18  Csaba Raduly  <csaba.raduly@sophos.com>
index 1aa9ef02b626ed61250e040be3748e05456511f2..247ba6748096f56153d4922a23a4314552529bb0 100644 (file)
@@ -1619,7 +1619,13 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy,
 
   request_set_header (req, "Referer", (char *) hs->referer, rel_none);
   if (*dt & SEND_NOCACHE)
-    request_set_header (req, "Pragma", "no-cache", rel_none);
+    {
+      /* Cache-Control MUST be obeyed by all HTTP/1.1 caching mechanisms...  */
+      request_set_header (req, "Cache-Control", "no-cache, must-revalidate", rel_none);
+
+      /* ... but some HTTP/1.0 caches doesn't implement Cache-Control.  */
+      request_set_header (req, "Pragma", "no-cache", rel_none);
+    }
   if (hs->restval && !opt.timestamping)
     request_set_header (req, "Range",
                         aprintf ("bytes=%s-",