]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Honor Pragma: no-cache for HTTP 1.0. The 1.3 proxy rewrite and 2.0 code
authorChuck Murcko <chuck@apache.org>
Fri, 28 Sep 2001 05:28:59 +0000 (05:28 +0000)
committerChuck Murcko <chuck@apache.org>
Fri, 28 Sep 2001 05:28:59 +0000 (05:28 +0000)
already handles both cases (Pragma: and Cache-Control:)
PR: 5668
Submitted by: Kim Bisgaard <kib@dmi.dk>
Reviewed by: Chuck Murcko

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@91170 13f79535-47bb-0310-9956-ffa450edef68

src/CHANGES
src/modules/proxy/proxy_http.c

index 7783afbbb733265f96620e42614cd623ff4b018d..059261b470b48b2e76cf4fb7ac0eaaa7a728dc89 100644 (file)
@@ -1,5 +1,8 @@
 Changes with Apache 1.3.21
 
+  *) mod_proxy - fix for Pragma: nocache (HTTP/1.0 only)
+     [Kim Bisgaard <kib@dmi.dk>] PR #5668
+
   *) PORT: Some Cygwin changes, esp. improvements for dynamic loading,
      and cleanups. [Stipe Tolj <tolj@wapme-systems.de>]
 
index fed6c42a488ff9af2595070f3866978cd561f7c9..d68ef28d2411b9ebc76ee46c1ab2ca17f9d9c88d 100644 (file)
@@ -171,7 +171,7 @@ int ap_proxy_http_handler(request_rec *r, cache_req *c, char *url,
                       const char *proxyhost, int proxyport)
 {
     const char *strp;
-    char *strp2;
+    char *strp2, *pragma;
     const char *err, *desthost;
     int i, j, sock, len, backasswards;
     array_header *reqhdrs_arr;
@@ -473,6 +473,14 @@ int ap_proxy_http_handler(request_rec *r, cache_req *c, char *url,
     if ((datestr = ap_table_get(resp_hdrs, "URI")) != NULL)
        ap_table_set(resp_hdrs, "URI", proxy_location_reverse_map(r, datestr));
 
+ /* If "Pragma: no-cache" set nocache and make reply un-buffered to
+ /* ensure timely delivery */
+    if (((pragma = ap_table_get(resp_hdrs, "Pragma")) != NULL &&
+        ap_proxy_liststr(pragma, "no-cache"))) {
+        nocache = 1;
+        r->connection->client->flags &= ~B_WR;
+    }
+
 /* check if NoCache directive on this host */
     if (nocache == 0) {
        for (i = 0; i < conf->nocaches->nelts; i++) {