From 76af8c05810dd1878ca27fee1e88c158229be5d5 Mon Sep 17 00:00:00 2001 From: Chuck Murcko Date: Fri, 28 Sep 2001 05:28:59 +0000 Subject: [PATCH] Honor Pragma: no-cache for HTTP 1.0. The 1.3 proxy rewrite and 2.0 code already handles both cases (Pragma: and Cache-Control:) PR: 5668 Submitted by: Kim Bisgaard 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 | 3 +++ src/modules/proxy/proxy_http.c | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/CHANGES b/src/CHANGES index 7783afbbb73..059261b470b 100644 --- a/src/CHANGES +++ b/src/CHANGES @@ -1,5 +1,8 @@ Changes with Apache 1.3.21 + *) mod_proxy - fix for Pragma: nocache (HTTP/1.0 only) + [Kim Bisgaard ] PR #5668 + *) PORT: Some Cygwin changes, esp. improvements for dynamic loading, and cleanups. [Stipe Tolj ] diff --git a/src/modules/proxy/proxy_http.c b/src/modules/proxy/proxy_http.c index fed6c42a488..d68ef28d241 100644 --- a/src/modules/proxy/proxy_http.c +++ b/src/modules/proxy/proxy_http.c @@ -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++) { -- 2.47.2