[http cache/json controller] ensure json_view does proper cache validation #390986
--- a/web/controller.py Tue Feb 09 08:15:20 2010 +0100
+++ b/web/controller.py Wed Feb 10 14:24:05 2010 +0100
@@ -154,6 +154,10 @@
rql = 'SET X %s Y where X eid %%(x)s, Y eid %%(y)s' % rtype
execute(rql, {'x': subj, 'y': obj}, ('x', 'y'))
+ def validate_cache(self, view):
+ view.set_http_cache_headers()
+ self.req.validate_cache()
+
def reset(self):
"""reset form parameters and redirect to a view determinated by given
--- a/web/views/basecontrollers.py Tue Feb 09 08:15:20 2010 +0100
+++ b/web/views/basecontrollers.py Wed Feb 10 14:24:05 2010 +0100
@@ -142,10 +142,6 @@
if view.add_to_breadcrumbs and not view.binary:
self.req.update_breadcrumbs()
- def validate_cache(self, view):
- view.set_http_cache_headers()
- self.req.validate_cache()
-
def execute_linkto(self, eid=None):
"""XXX __linkto parameter may cause security issue
@@ -350,6 +346,7 @@
except NoSelectableObject:
vid = req.form.get('fallbackvid', 'noresult')
view = self.vreg['views'].select(vid, req, rset=rset)
+ self.validate_cache(view)
return self._call_view(view)
@xhtmlize