summaryrefslogtreecommitdiff
path: root/addons/web/common/http.py
diff options
context:
space:
mode:
authorniv-openerp <nicolas.vanhoren@openerp.com>2012-07-26 16:20:57 +0200
committerniv-openerp <nicolas.vanhoren@openerp.com>2012-07-26 16:20:57 +0200
commit26aaa7d9a7ac454141129e35d4469c44d2abcf06 (patch)
treef85b61df1463491f3afdcdfd565fbe551cb0c275 /addons/web/common/http.py
parent9155ba655da0ff1daabff8836ad3b3da976c7e2f (diff)
[IMP] improvement to cache control
bzr revid: nicolas.vanhoren@openerp.com-20120726142057-7nf7wii9t37b6xo0
Diffstat (limited to 'addons/web/common/http.py')
-rw-r--r--addons/web/common/http.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/web/common/http.py b/addons/web/common/http.py
index bb87d719bad..a70ef53a91c 100644
--- a/addons/web/common/http.py
+++ b/addons/web/common/http.py
@@ -425,8 +425,8 @@ class DisableCacheMiddleware(object):
def start_wrapped(status, headers):
referer = environ.get('HTTP_REFERER', '')
parsed = urlparse.urlparse(referer)
- debug = not urlparse.parse_qs(parsed.query).has_key('debug')
- filtered_headers = [(k,v) for k,v in headers if not (k=='Last-Modified' or (debug and k=='Cache-Control'))]
+ debug = parsed.query.count('debug') >= 1
+ filtered_headers = [(k,v) for k,v in headers if not (k=='Last-Modified' or (debug and (k=='Cache-Control' or k=='Expires')))]
if debug:
filtered_headers.append(('Cache-Control', 'no-cache'))
start_response(status, filtered_headers)