diff options
| author | niv-openerp <nicolas.vanhoren@openerp.com> | 2012-07-20 15:01:00 +0200 |
|---|---|---|
| committer | niv-openerp <nicolas.vanhoren@openerp.com> | 2012-07-20 15:01:00 +0200 |
| commit | c9ff048d924f18e49e0b65cd4159305d1fe4d5a5 (patch) | |
| tree | 7d1f60af413169fe0c9962cc01c4806e9d92aace /addons/web/common/http.py | |
| parent | 52f6f0bd0437a0735cd3020a8786047c0fb00652 (diff) | |
[IMP] debug mode
bzr revid: nicolas.vanhoren@openerp.com-20120720130100-olttd8ovamdtywtt
Diffstat (limited to 'addons/web/common/http.py')
| -rw-r--r-- | addons/web/common/http.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/web/common/http.py b/addons/web/common/http.py index 87748d2e6d9..bb87d719bad 100644 --- a/addons/web/common/http.py +++ b/addons/web/common/http.py @@ -28,6 +28,7 @@ import werkzeug.wsgi from . import nonliterals from . import session from . import openerplib +import urlparse __all__ = ['Root', 'jsonrequest', 'httprequest', 'Controller', 'WebRequest', 'JsonRequest', 'HttpRequest'] @@ -422,7 +423,9 @@ class DisableCacheMiddleware(object): self.app = app def __call__(self, environ, start_response): def start_wrapped(status, headers): - debug = environ.get('HTTP_REFERER', '').find('debug') != -1 + 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'))] if debug: filtered_headers.append(('Cache-Control', 'no-cache')) |
